As we all know, eyes are fragile and the skin around eyes are the thinnest. Healthy eyes provides clear sights and not any pains. Usually a slight pressure on healthy eyes will not cause any pains. Therefore, the pains may caused by your hard pressure that beyond eyes can bear. If a moderate pressure also result in pains, you should check your eyes to see whether it has any symptoms of infection. If you unfortunately get infections, you should visit the doctor and put pressure on it.
I'm not sure the degree of your pressure, if you press your eyes too heavy, they'll definitely feel hurt. If not, you may probably have eye problems. It may be infection, inflammation, eye floaters, etc.
But there's no need to worry, wash your eyes with pure water or physiological saline at first, then use some artificial tears to relive your eyes. Then close your eyes for a while. Do this remedy at home three times a day, if it doesn't work, see a doctor immediately.
It is difficult to say what is wrong with your eyes based on your description. Eye pain is usually described as throbbing, stabbing, burning, gritty, sharp or dull pain in eyes. Normally eye pain is classified as ocular or orbital pain. Ocular pain is the pain from outer structure of eyes and it is caused by some eye problems such as blepharitis, conjunctivitis, corneal abrasion/ ulcer, chemical burns or sty. As to orbital pain, which refers to a deep, dull pain in or behind eyes, is normally connected with diseases like glaucoma, optic neuritis, iritis, migraines or trauma. I think it is better for you to visit an eye specialist for detailed examination. After all, timely and proper treatment is very important for eyes. Besides, pressing on eyes will cause intraocular pressure increased. I think it is better not to press or rub eyes.