Jami` at-Tirmidhi Book 10, Hadith 39
The Messenger of Allah said: "No one dies and they stand over him crying and saying: 'O what a great man he was! O how respectful he was!' except that two angels are appointed for him to poke him (saying): 'Is that you?'"
The Messenger of Allah said: "The deceased is punished for the crying of his family over him."
The Prophet said: "The deceased is punished for the crying of his family over him." So, Aishah said: "May Allah have mercy upon him. He has not lied, but he is mistaken. It is only that the Messenger of Allah said about a Jewish man who died: 'The deceased is being punished and his family is crying over him.'"