Why do I tend to get headaches when sleeping too much?

See your doctor. Having recurring illness is troubling. In order to achieve a specific and correct doagnosis with symptoms like this, you'll need to visit your doctor. Only after a face-to-face evaluation will he/she be able to properly diagnose and treat you.