I often end up sleeping more than 12 hours with several wakes in the middle. The result is that I have a headache and feel sleepy during day. Why?

Yes, and... Good thoughts by Dr. Baker. Do you know if you snore a lot (e.g. others report)? Are you quite overweight? Sleep apnea is a very, very common diagnosis these days, with some questions as to why that would be so. Without entering that, polysomnography can provide diagnosis. Interestingly, many people prescribed CPAP, use for a while, stop using. Interesting discussion. Stress an issue?
Probable sleep apnea. It is impossible to know without testing, but this sounds very classic for sleep apnea, a surprisingly common condition. Whatever the cause turns out to be, i strongly advise getting a sleep study to determine your diagnosis. You can find a center that does this here: http://www.Sleepcenters.Org/.