Take 1-2 tablets of Motrin (ibuprofen) 200mg or Tylenol (acetominophen) 500mg every 4-6 hours with water. Do not exceed 4000mg of Tylenol in a day because it is liver toxic. My favorite remedy for headaches, though, is Aleve (naproxen) 250mg which can be taken twice a day for a few days. Be warned that naproxen, like most NSAIDs, can cause stomach discomfort so they may be taken with food. If you are also having trouble with sleep, then I'd recommend taking a combination drug with Benadryl (diphenhydramine) at night with the aforementioned pain relievers. It is an antihistamine which causes drowsiness. These combination drugs are usually labeled "night-time pain relief" or something to that effect. There are more medicines that can be taken for headaches but they are not sold over-the-counter, and may need a prescription or the consent of a pharmacist to purchase.
Do not take these drugs for longer than a few days to a week.
If your headaches persists, then you should seek the advice of a physician as they may only be the symptomatic manifestations of a more serious ailment.