There are many causes of headache but the most common of which is tension headache which is mostly associated with stress. This is usually relieved by rest. Also problems with the eye such as that of astigmatism, myopia, or glaucoma can present with headaches. If there is no distinct pattern then this can be a non-specific migraine and would need to be evaluated by a neurologist thoroughly.
As there can be lots of possibilities, it is best to have yourself examined by your doctor to try to narrow down the causes.