Hi and thanks for the query.
These are known as Sexual Headaches or Coital Cephalalgia. As an entity these are benign and occur in 1 percent of the population. This can occur at any age.
The treatment is by NSAIDs painkillers and sometimes, beta blockers need to be given as an adjunct. In brief, you should visit your PCP and get a more thorough evaluation done and a prescription so that they can be alleviated permanently.
Please do not forget to leave a positive rating by clicking on stars on top right corner.
Wish you good health.