This is a fatwā from Sheikh ibn Jibrīn (رحمه الله) that has been translated into English. He (رحمه الله) was asked:
"One of my relatives died and he was an unrighteous man throughout his life, although he did pray. So is it permissible to invoke Allāh's Mercy upon him and to supplicate for him after his death?"
Then he (رحمه الله) responded:
"It is permissible to supplicate for him and to invoke Allāh's Mercy upon him so long as he was a Muslim and professed the Shahādatain (the two testimonies) and he prayed and performed the apparent rites of the religion. It is his right that supplication be made to forgive his sins and the evil he commited, in the hope that the supplication of the Muslim will be accepted and he will have his sins erased." (1)
The benefit of this fatwā is that it is permissible to invoke Allāh's Mercy upon an unrighteous individual, just so long as he was a Muslim who professed the Shahādatain. One may supplicate to forgive him for all of his sins and for the evil that he has commited.
May Allāh bless you, and shukran.
Sources :
1. Fatāwā Islāmīyah vol no. 1, page no. 111