Can be many reasons
Headaches can be a symptom caused by many different factors and conditions.
Your body is speaking to you. Listen. If it was self limiting and went away you could forget about it. Since it is not, go to your doctor and let a trained professional evaluate your symptom and treat it while it is simple and not wait until it becomes more complicated.