According to your description, the condition that your head hurt when your eyes move is due to inappropriate use of eyes. You may usually have been using your eyes for a continuous long time without good rest or sleep. You should adjust your work-and-rest time system. Do not overuse your eyes. If you have to read or stare at the computer screen for more than six hours, you should take a break of at least half an hour every other hour. Do regular eye exercises to reduce the pressure and fatigue state of your eyes. Usually look at distant objects. Apply some anti-fatigue eye drops to moisten your eyes.
Well, according to some experts, the condition you have got could be eye strain. And in common, it is caused by improper focusing or when the two eyes are not properly aligned. And that is why your head hurt when you move your eyes. And of course, for the causes, it can be because of the overuse of eyes. Also, long term use of glasses can lead to it too. So just be careful about it. By the way, you can just have some cool cucumber on your eyes and then have some cold compresses. In that way, it can just relieve your symptoms.