Thank you for asking. Masturbation is not harmful, but excessive masturbation can be harmful. It can be very addictive. Compulsive masturbation is a condition where one is not able to control masturbating, it is often associated with guilt, anxiety if one tries not to masturbate, Difficulty in concentration can be seen, etc. When it becomes a priority over other important things in life, when most of the time and resources is spent in procuring the habit, then it is considered as a problem. Most importantly, it is completely treatable. If not attended timely, it can cause problems with maintaining erections during sex in future.
Next Steps
For more information regarding this and for specific instructions and management plan you can consult with me directly here on practo.
Health Tips
Don't worry. It is treatable and consult with a sexologist.