First of all, we’d like to state that masturbation is generally considered forbidden in Islam since it is deemed to fall under the category of sexual satisfaction outside the framework of marriage. However, when it is the only choice instead of committing the major sin of Zina (fornication or adultery), one can resort to it without exaggeration bearing in mind that he/she should do his/her best to satisfy his/herself within marriage. So, the ruling on masturbation is governed by some considerations that might change the ruling from one person to another.
Answering the question, Sheikh Ahmad Kutty, a senior lecturer and Islamic scholar at the Islamic Institute of Toronto, Ontario, Canada, states:
“In Islam marriage is a partnership based on mutual rights and obligations. It is, therefore, important that both spouses try their best to be considerate and sensitive towards the needs and feelings of one another and do their best to satisfy each other within the bounds of Islam.
Sexual fulfillment is an important part of the mutual obligations of husband and wife. The husband definitely needs to be aware of his duty towards his wife in this respect, and take it seriously. Just as she has a duty to satisfy him, he is also obligated to satisfy her.
Should he be suffering from a sexual dysfunction, he is required to seek professional advice in order for the marriage to be a happy one. If he cannot satisfy the wife through sexual intercourse, he is perfectly justified in satisfying her through other avenues; he could very well masturbate her; if he were to do this, he is working within the perfect limits of Islam; his doing it on his wife is different from her doing it on herself. A person masturbating on himself/herself is not allowed in Islam except in dire necessity where one fears falling into adultery; marriage is intended in Islam to be a shield against that. So being married, the spouses should never be forced into this option.
If in spite of best efforts to convince the husband, he still remains insensitive to his wife needs in this respect, she is justified in taking whatever steps are necessary in terminating the marriage, if she is unable to tolerate it. This is definitely one of the valid grounds for divorce in Islam. This can be inferred from the following incident reported in the authentic traditions; once a woman appeared before the Prophet (peace and blessings be upon him) and told him, I cannot find fault with my husband in matters of religion or character; but he is a total misfit (as far as sexual function is concerned). The Prophet (peace and blessings be upon him) we are told, ordered a termination of the marriage.”