That's completely normal for someone your age and NOT causing your headaches!! Masturbation is perfectly healthy and doesn't have any negative side effects. If anything, it should leave you feeling calm and happy. Probably temporarily tired, too. But nothing that lasts.
This might sound weird, but are you sure you aren't holding your breath when you masturbate or something?? Or perhaps your headaches are totally unrelated, do you get enough sleep/food/water? Watching TV too much or the computer? All these things can cause headaches and are much more likely than your masturbation.