By far the most common cause of this type of pain, especially if it is occurring in both eye, is simply strain of the eye muscles. This is especially common in people who work at a computer screen all day or perform other task that require careful use of their eyes. Usually it improves with regular rest periods and with reducing environmental work problems, like glare on the computer screen. However, a fair number of people who have this kind of eye strain actually have a minor vision problem (such as near sightedness) that has been undiagnosed; if they wear appropriate corrective eye wear then the strain tends to go away!
Therefore, my first recommendation for you would be that you go to see your eye doctor
for a complete vision check up if you have not done so recently. They will be able to determine whether you need corrective eye wear. They will also be able to make some additional recommendations on how to reduce eye strain.
Rarely, eye pain like this can be a sign of a more serious eye problem, especially if there is redness of the eyes, blurry vision, or pain of the eyeball itself. If you have these symptoms, you should seek emergency attention from your eye doctor.