First, I highly doubt that masturbation is responsible for pain in your legs, unless you are sitting or lying in some very awkward position during that activity. That's a fairly high level of masturbation, but not all that unusual. At your age, many guys have a pretty high sex drive & do it frequently.
I think the reason you are ejaculating too quickly may be related to your technique - you may have gotten into the habit of masturbating rather quickly & have sort of 'trained' yourself to get off very quickly. I just discussed this in another thread the other day - you should try the 'start & stop' technique. As you stimulate yourself & feel you are getting close to climax, stop & wait for 1/2 a minute or longer, wait for the urge to ejaculate to diminish somewhat, then begin again. As before, when you feel you're getting close, stop, take a few breaths & wait for the urge to fall away a bit. You can do this as many times as you wish, but obviously at some point you can go ahead & allow yourself to finish. As you do this with each 'session', you'll find over time that you'll gain better control over orgasm & ejaculation & you should be able to last longer both solo & with a partner. Also, you may find that when you finally do ejaculate, the sensation will be stronger, more satisfying & you'll almost certainly ejaculate a bigger load. All these things will make sex (alone or with a partner) more enjoyable for you AND your partner.