No, masturbation should not affect your weight. Masturbation is a perfectly healthy activity that we all partake of at some time our other (I do it on average once a day). So don't get hung up about that.
If you are worried that you have a weight problem then I suggest you see a doctor to discuss what could be the real issues (if this is an issue at all).
Wendy