It seems that there is something wrong with your eyes. So, generally speaking, our eyes hurt due to a lot of reasons. So, since your eyes haven't got other problems, therefore, the painful feelings may have resulted from overuse of your eyes or a lack of sleep. Anyway, an eye strain could lead to painful eyes. Here I recommend you getting some eye drops to deal with it. If anything bad happens, try to visit a doctor.
It can be caused by a sinus infection or tension or cluster headaches. If you suffer an infection in the sinus cavity, in the course of the immune response against the infection, the sinuses get inflamed and produce pain and pressure to the eyebrows and the upper cheeks. Therefore, you feel the top part of your eyes is hurt. Under such circumstances, you can use antibiotics and pain killers to treat it. If you suffer from tension headaches, you should have a good sleep and relax yourself. If you have cluster headaches, you should be treated with prescription pain-killing medications. In addition to above common causes, acute closed angle glaucoma and temporal arteritis can cause pain on the top part of your eyes. I advise you to go to hospital for an thorough examination. Wish you feel better soon.
There may be some problems for your eyes since you feel the hurt at the top part of your eyes. The eye pressure may cause such problems. You'd better go to see the doctor and have a full check on the eyes to see whether your eyes have the problems, like the infection on eyes and so on. Then you could accept the medical treatment.