yep, calories get burned off 24/7; even when sleeping. The number that get used up depend on the level of activity. For example masturbating whiel lying in your bed burns far fewer than masturbating while bicycling at 30 mph along the highway.
If you are concerned with losing weight or trying to avoid putting on weight, then you do need to be concerned with not consuming more calories than you burn off (or conversely making sure you burn off at least the number of calories you consume). However, masturbation by itself is not going to do it for you unless you eat so little it would barely keep a chicken alive. Thus you need to combine regular masturbation with other forms of exercise as well as controlling your calorie intake. Just remember that masturbation and operation of a vehicle, heavy machinery or power tools can be dangerous so better to masturbate before rather than during any of those.