It's called a benign coital headache. I get them occasionally. For me, they usually occur if I have sex when i've been tired or stressed and have very vigorous sex. When I orgasm, my whole body tenses up where all my muscles in my body are all clenching at once. Occasionally, this will cause a MONSTER headache in the back and sides of my head sometimes lasting up to an hour.
It's annoying, but doesn't happen very often for me fortunately.