You need to refocus your mind on other things to break the addiction. I don't know what it might do to you physically, but it probably isnt good. I can say this, because it is very bad for you mentally. It is not the harmless rite of passage that so many people believe it to be.
Every time your mind tells you to do this to yourself, you need to remove yourself from the isolated area you are likely in when this is happening. Become active, especially socially. Find people who are not talking about sex all the time. Find people who get more out of life than talking in this manner. There really is so much more to life. I do know that this is a principle of breaking the cycle of addiction, regardless of the addiction. People with drug or alcohol addictions must seek association with people not involved with this addiction. People who had once been in trouble as a minor with a bad crowd, must seek new and better associations if they want to break from the trouble they had gotten into as a youth.
When you are with people who might only "occasionally" make lewd or dirty sex jokes. Don't acknowledge what they just said. Look for an opportunity to change the conversation naturally to something else. If they refuse to stop, remove yourself from the group, at least for a while, until they respect your desire to not speak in this manner. If they start teasing in a bad manner, which young men are likely to do, it is time to find new associates.
Think about a healthy activity that you might like to do that would also be a social type of activity and find a group that at least talks about the activity you're interested in. Like, long distance bicycle riding groups. If people in the group talk about things they shouldn't be talking about, get involved with a different group of people. But, make sure it's an activity you truly enjoy. If you like the activity but not the people, find a different group.
whaaaaat? there is nothing wrong with masterbating. two or three times a week is perfectly fine and healthy.
seriously, can we get rid of the religioun when dealing with medical issues? c'mon.
The only problems that masturbation can cause is skin irritation and falling asleep in class after a long session at night. It does not cause infertility or disease. You get AIDS from sex with other people, not yourself. Finding a girlfriend can also help.