Masturbation is not permissible because this is a kind of fulfilling the sexual desire in a way other than that which Allah made lawful such as one's wife and slave girls. Also, it has many harmful consequences for a person's health. Allah directs those who can not marry to be chaste when He (Exalted be He) says,
And let those who find not the financial means for marriage keep themselves chaste, until Allâh enriches them of His Bounty.
The Prophet (peace be upon him) directed the youth (Part No. 22; Page No. 65) who can not marry to observe fasting because it limits the sexual desire. Those who practice this masturbation are not adulterers but they commit a sin and they should repent of it.May Allah grant us success. May peace and blessings be upon our Prophet Muhammad, his family, and Companions.