All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad is His slave and Messenger.
It is permissible to visit the relatives of a dead person in order to console them because consoling a Muslim for the death of his relative is desirable as the Prophet said: “There is no Muslim who consoles his fellow Muslim except that Allaah would clad him with precious garments of dignity on the Day of Judgement.”
Likewise, supplicating for a dead person is lawful, as regards gathering at homes and the like for consoling a person who lost a relative, then the scholars differed in opinion about its ruling, the Hanbali and Shaafi’i Schools of jurisprudence are of the view that this is disliked, whereas the Maaliki School of jurisprudence permitted it, and the Hanafi School of jurisprudence is of the opinion that this is less appropriate to do.
However, what the people are accustomed to do nowadays, like gathering and preparing food and drinks for the people who come to console them, and serve them the food in the same way as in weddings and special occasions, then this is an innovation.
For more benefit, please refer to Fatwa 85808.
Allaah Knows best.