You already found the answer. It is scratching (one's head, chin, neck etc.). There isn't a special phrase for that, it is just a gesture and part of body language.
Scratching can indicate different emotions or states of mind, depending on where you scratch and other accompanying gestures. For example:
- Scratching back of your head with a sheepish smile can indicate embarrassment
- Scratching your chin/cheek and pouting can indicate anxiety and frustration. You might be dealing with a question also as your pictures show.
There can be many reasons also as the below picture suggests:
Decoding Body Language / slideshare.net
Beside gestures, scratch one's head is an idiomatic phrase also:
1 informal Think hard in order to find a solution to something.
1.1 Feel or express bewilderment.
[OD]