Hello! Please remember that my response is for information only, we are not establishing a therapeutic relationship.
It's a good thing that you are identifying this behavior as a problem. What you are describing is a sexual addiction -- which describes the behavior of a person who has an unusually intense sex drive or an obsession with sex. Sex and the thought of sex tend to dominate the sex addict's thinking, which can make it difficult to work or to engage in healthy personal relationships.
It would be best if you got some help rather than trying to control the behavior all by yourself. Treatment for sexual addiction generally revolves around helping the person develop a healthy sexuality. It might include individual therapy, a 12 step program like Sex Addicts Anonymous (SA), and in some cases, the use of an antidepressant medication to help control the obsessive thinking that co-occurs with sexual addiction.
Here is one website you can use to look for SA meetings: http://www.sa.org/index.php
To find a therapist you can look here: www.psychologytoday.com, www.therapytribe.com , http://www.find-a-psychiatrist.com/
I think that treatment is the best option because it's very difficult if not impossible to overcome an addiction like this by one's self. However, I'll give you a few ideas of things you can try on your own as you look to pursue treatment/help.
1. Look for the cause -- It will tempting to look at this from a shallow perspective (boredom, feels good, etc) --but try to look deeper --what pain do you have from your past? What are you trying to escape from? Try to be as honest as you can be. This might be difficult to do on your own without the help of a therapist, but you can give it a try. Dealing with the pain honestly (without escaping) will be one important task for overcoming the addiction.
2. Name your feelings and address them -- You might say "I am bored," or "I am lonely," but then you need to learn how to tolerate these feelings --which again is difficult to do without help and support.
3. Examine thought patterns --your current belief probably has something to do with the idea that the masturbation is necessary -- identify what your beliefs about masturbation specifically are --Examine what is true and what is false about these beliefs. How else can these beliefs be addressed besides masturbation.
4. Identify the most difficult time of day and change habits --if night time is hard, exercise before bed to burn some testosterone or oestrogen. Don't lie done during the middle of the day --try changing around your routine to be occupied during your most difficult times.
Please don't rate my answer until you are satisfied --I'd appreciate it if you would follow up first and ask questions.