Typically these small muscle spasms or twitches are a sign of fatigue. This would be from lack of restful sleep or possibly mineral (magnesium or potassium) deficiency.
Where one gets them varies. I suspect the location depends upon the factors that would strain or fatigue the muscles, such as previous injury or present activities. When I was in HS, when I participated in various sports and stayed up quite late studying, I would get them in my thighs. Whenever this happened, I learned that I needed at least an extra hour of sleep the following night.
In the case of side-of-your-head, I would suspect sleep + jaw tension. Note that your teeth should not touch except when chewing. If they do, it is a sign of jaw muscle tension.