ANSWER: The word "masturbation" we commonly use for the act is not found in the Bible. The word itself came from combining the Latin words masturbari (meaning 'hand') and stuprare (meaning 'to defile'). The answer to your question regarding this act of self-pleasure depends upon which Biblical standard we are using.
There is one answer the Bible offers, in regard to masturbation, if we are referring to the Law received by Moses (under which the Old Covenant was offered) and another answer if we use the Christian standard Jesus Christ and the apostles taught as being required under the New Covenant. In the Old Testament, the primary focus was on the breaking of "the letter" (the narrow, strict interpretation) of the law. In the New Testament, the focus shifts towards sin being imputed based on a person's thoughts and goals, judged against the spiritual INTENT of the law, whether or not any action is taken.
Clearly, the standard believers are held to in the New Covenant are far higher, and more difficult to keep, than what was required under the Old Covenant. This is why the power of God's Holy Spirit needs to reside in a person before they can obey and please him. True Christians do not need the Eternal to write his precepts in stone so that they can follow them but instead must have him write his laws on their hearts (Romans 2:14 - 15).
Jesus' famous Sermon on the Mount is noteworthy in many respects. One of its chief characteristics is that, for the first time, God begins to explain the New Covenant offered to all humans as well as revealing the spiritual intent of many of his laws that those who wish to have a relationship with him must follow.
27. You have heard that it was said to those in ancient times, 'You shall not commit adultery.' (which is the seventh of the Ten Commandments, see Exodus 20:14) 28. But I say to you, everyone who looks upon a woman to lust after her has already committed adultery with her in his heart (Matthew 5:27 - 28, HBFV).
Jesus reveals that, in order to be considered obedient to God, it is no longer enough for humans not to act on their thoughts and desires. In this particular example, those under the Old Covenant were only required to not commit the physical act of adultery. In God's new agreement offered to man, however, which requires the keeping of the commandments both in thought and in deed, lusting for another person in one's heart (before any act is committed) is considered an act of disobedience.The act of masturbation is not specifically condemned or punished based on "the letter" or strict reading of God's law found in the Old Testament. No verses specifically list it as being unacceptable. That said, based upon the spiritual standards outlined in the New Testament, the lust that generally leads to the act (and, of course, the act itself) is considered sinful.
True love for another person means we should seek not to harm them, in any way, as the Apostle Paul states (Romans 13:10). Christians are commanded to grow toward perfection and stop sinning even in our thoughts. We are promised in the Bible that if we do err in our hearts and lust (whether or not it leads to masturbation), we can be forgiven for our sin if we confess them to our heavenly Father (1John 1:9).