Gynecomastia is common in puberty and usually goes away within 2 to 3 years. However, sometimes it does not go away. When it doesn't, the only option for getting rid of it is surgery. With surgery, there is usually a combination of liposuction and excision of the gland. You can watch a video on YouTube if you type in "gynecomastia surgery". Sometimes it is possible to treat the condition with liposuction only.
Masturbation has nothing to do with the condition. It is simply brought on by a hormone imbalance, and this especially happens to young men whose bodies are growing and maturing. Most of the time, the hormone imbalance corrects itself and the gyne goes away.
Exercise typically doesn't do much for gynecomastia. It can improve the appearance of breasts that are mainly composed of fat (from being overweight), but if there is true growth of the gland underneath, exercise will do nothing to that tissue. The only way to truly do something about it is to have it surgically removed.