While the Bible doesn’t specifically mention masturbation, we can find a clear principle about the appropriate sexuality and how this practice isn’t in God’s will.
In Matthew 5:28, Jesus teaches that when a man lusts in his heart, he has already committed the act of adultery. He also says that out of the heart proceed impure thoughts that defile a man (Matthew 15:19, 20).
Masturbation is fornication in the biblical sense. The word “fornication” in scripture means “immorality.” The “works of the flesh,” listed in Galatians 5:19-21, include fornication. Also, listed is “uncleanness” which means “impurity,” and “lasciviousness,” which is “unrestrained lust.” All three include the act of masturbation. “They which do such things shall not inherit the kingdom of God.” Of course, this means, “unless they repent.” When a person asks for forgiveness and forsakes any sin, he is at once accepted of God (1 John 1:9).
When we are in doubt, we should ask ourselves, “What would Jesus do?” Jesus never married, but we know He was subject to the same passions and temptations as we. He had to subdue and control His inherit passions, for He was without sin.