All Perfect Praise be to Allah, The Lord of The Worlds.
Specifically, masturbation (Istimna`) refers to the act of seeking to release sperm through other than lawful sexual intercourse, and generally, to any type of stimulation of the genitals in a sexually pleasurable way.
According to the opinion of the majority of the scholars, masturbation, in all its forms, is prohibited (Haraam). The evidence on this is the verse in which Allah the Almighty Says (What means): "Who abstain from sex, Except with those joined to them in the marriage bond, or (the captives) whom their right hands possess,- for (in their case) they are free from blame, But those whose desires exceed those limits are transgressors;-" {Al-Mu`minun, 5-7}. In addition, when a man releases his sperm through other than lawful sexual intercourse, this leads to not having children, and thus it (Masterbation) is prohibited similar to sodomy." Kindly refer to {Al-Majmou`, 18/267}.
The prohibition of masturbation can be arrived at through three evidences:
First: "Who abstain from sex, Except with those joined to them in the marriage bond, or (the captives) whom their right hands possess,- for (in their case) they are free from blame, But those whose desires exceed those limits are transgressors. "According to this verse, it is allowed to have sexual pleasure only with one`s wife or female captive. Thus, every other means is prohibited, and one who exceeds the limits set by Allah, in this regard, is a transgressor, and transgression is prohibited. Ibn Katheer (May Allah have mercy on him) said, " Al-Shafie and scholars who agreed to his view have based their prohibition of masturbating by hand on the above verse. Al-Shafie said, sexual pleasure is fulfilled only by having sexual intercourse with one`s wife or female captive. Allah the Almighty said, ", But those whose desires exceed those limits are transgressors."{Tafseer al-Qur`an, 5/463}.
Second: Abdullah (b. Mas'ud) (Allah be pleased with him) reported that Allah's Messenger (PBUH) said to us: "0 young men, those among you who can support a wife should marry, for it restrains eyes (from casting evil glances) and preserves one from immorality; but he who cannot afford It should observe fast for it is a means of controlling the sexual desire." {Bukhari & Muslim}. The Prophet (PBUH) urges young men who can support a wife to get married and those who can`t afford that to fast for it is a means of controlling the sexual desire, and preserving one from immorality. Had masturbation been permissible, the Prophet (PBUH) would have mentioned it and wouldn`t have instructed the young men to observe fast while they can masturbate.
Third: It was proven that masturbation causes health problems, and, according to specialized doctors, affects man`s sexual performance with his wife to be. It could also lead to sterility and poor concentration, in addition to other serious health problems.
One who masturbates must quit immediately and abstain from whatever (Evil glances and thoughts) arouses his sexual desire including foods. Instead, he must observe fast on frequent basis because it is a means of controlling sexual desire. And Allah, The Almighty Knows Best.