The Messenger of Allah ﷺ said, "It is not lawful for a woman to mourn for any deceased person more than three days, except for her husband."
أخبرنا إسحق بن إبراهيم قال أنبأنا سفيان عن الزهري عن عروة
أن رسول الله ﷺ قال لا يحل لامرأة تحد على ميت أكثر من ثلاث إلا على زوجها
Muslim narrated it in the Book of Divorce, the chapter on the obligation of mourning during the waiting period of widowhood and its prohibition otherwise, except for three days, hadith 1491, from the hadith of Sufyan bin Uyayna, with this wording. It is also found in al-Kubra, hadith 5719.