Why does my eyes hurt when I wake up?

Recurrent erosion. Multiple causes but a classic cause is a condition known as recurrent erosion syndrome. It can also be from run of mill dry eyes.
Headache. Headaches, light sensitivity and other causes can be at work. If this has been happening for some time, it could be dry eyes or an inflammation. If this is a recent event, and occurs daily, have an eye doctor take a look. There is often a simple explanation for the irritation, and possibly an easy fix.