Answer
In the Name of Allah, Most Gracious, Most Merciful.
All praise and thanks are due to Allah, and peace and blessings be upon His Messenger.
In this fatwa:
If you ask Allah to send the reward of a good deed you did to another person, it is not wrong of you to ask that, and Allah may accept this request of yours. The best way to help the deceased is to constantly pray for them.
Answering your question, Sheikh Mustafa Umar, President of California Islamic University, states:
Everyone is responsible for performing their own deeds. Neither good deeds nor sins transfer between people. However, if you asked Allah to send the reward of a good deed you did to another person, it is not wrong of you to ask that, and Allah may accept this request of yours. Nonetheless, this was not a normal practice of the Prophet (peace be upon him) or the Companions, so it should not be done regularly. The best way to help the deceased is to constantly pray for them.
Allah says, “For them is what they earned and for you is what you have earned. And you will not be accountable for what they have done.” (Al-Baqrah 2:141)
The Prophet (peace be upon him) said, “When the son of Adam dies, all his actions cease except for three: a continuous charity, knowledge which others benefit from, or a righteous child who supplicates for him.” (Muslim)
Aishah (may Allah be pleased with her) said that a man came to the Messenger of Allah and said, “My mother died a sudden death and did not leave a bequest in her will. I believe that were she able to speak she would have donated to charity. If I donate on her behalf, will the reward reach her?” The Messenger of Allah replied, “Yes.” (Muslim)
Abdullah ibn Abbas said that a woman from the tribe of Juhaynah came to the Messenger of Allah and said, “My mother had made a vow to perform Hajj but was unable to do so until she died. Can I perform Hajj on her behalf?” The Messenger of Allah replied, “Yes, perform Hajj on her behalf. If she had a debt, wouldn’t you pay it back for her? So pay off her debt to Allah, for He is more deserving of [His debts] being fulfilled.” (Al-Bukhari)
Many scholars said it is allowed to ask Allah to send the reward of good deeds you perform to another person (known as isaal ath-thawaab). (See (Ibn Abidin, Radd al-Muhtar; Hattab, Mahawib al-Jalil; An-Nawawi, Al-Minhaj; Ibn Qudamah, Al-Mughni)
Almighty Allah knows best.
Source: AsktheSholars.com