Sharp pain in the eyes can be caused by several factors. The most common cause is allergies or a stye. Conjunctivitis is also a frequent cause of sharp eye pain.
You might have what is commonly known as an eye migraine. That comes from having and not treating bad vision, such as a cataract, or it might be a typical of an eye infection.