Hello and thanks for your question. I assume this happens in both eyes? Have you had an incidental trauma to the eyes, such as a paper scratch, a twig glancing across the front of the eye, or a fingernail scratch?
Do you wear contact lenses? Does it feel like someone has ripped the skin off your eyes?
Your symptoms can be from a handful of different causes. Sometimes people wake up with a stabbing pain that almost feels as though someone ripped the skin right off their eyeball. If this sounds familiar than this is likely a corneal abrasion or scratch. For people who describe waking up to this type of phenomenon, they sometimes have a history of an incidental trauma such as a twig glancing across the front of their eye, or a paper scratch or child's fingernail scratch to the eyeball at some point in the past. This incidental trauma can set off a reaction in the epithelium (superficial most layer of the cornea) that causes that portion of the epithelium to no longer adhere its underlying stromal (substance) tissue of the cornea, predisposing to corneal abrasions, or scratches, that often present like this. The kicker about this is, though, even when the patient makes it into the eye doctor's office within a few hours of the onset of the pain, the scratch is often times completely healed or almost totally healed so that there is very little to no evidence of this. In this respect, the patient's historical encounter goes a long way towards the diagnosis, which is called recurrent abrasion or recurrent erosion syndrome.
Even if you don't have that characteristic sensation of having the front of your eyeball ripped off upon first wakening, this may still be a corneal abrasion or scratch, even if it is not related to a recurrent abrasion syndrome. Just rubbing the eye, or having gotten something in the eye can cause an abrasion which may lead to this sharp, stabbing pain; in many instances this can feel like a foreign-body is in the eye as well.
In the absence of a corneal abrasion, this could also be related to just a dry, irritated eye. Dry eyes often times provide this stabbing pain in the eye which can last for several hours to days.
My first treatment advice for all of these problems would be to start using artificial tears 4-5x/day in both eyes on a consistent, daily basis. You can also use some lubricating ophthalmic ointment, although the use of that will certainly blur the vision, so you may choose to use that only before you go to bed, or after work at the very least. You can buy both of these over-the-counter at the drug store; generics work just fine, just don't buy any artificial tears that say get-the-red-out or redness reliever.
Alternatively, if this recurrent abrasion scenario sounds familiar you could also try using Muro 128 ointment in your eyes at night, before you go to bed. You can buy this over-the-counter in most drug stores. This can help with this recurrent abrasion syndrome which you may have.
Does that make sense?