I have headaches associated with pain from my left eye but when I close my left eye the headache and pain gradually goes away. What's causing it?

Asthenopia? You may have some eye strain cause by difference in the shape of your two eyes. If one is slightly shorter than the other you will have a difference in prescription which if untreated could cause strain in one eye.
Inflammation. One possibility for your discomfort is a type of inflammation of the eye called iritis or uveitis. It is usually associated with light sensitivity, and closing the eye may relieve this. Additionally, dry eyes can lead to mild headaches (stress or muscle tension) that would resolve once the dry eyes improve (by closing the eye). See an eye doctor to further evaluate this.