The Messenger of Allah ﷺ said, "It is not lawful for a woman who believes in Allah and the Last Day to mourn for any deceased person more than three days, except for a husband."
حدثنا هناد بن السري حدثنا أبو الأحوص عن يحيى بن سعيد عن نافع عن صفية بنت أبي عبيد
قال رسول الله ﷺ لا يحل لامرأة تؤمن بالله واليوم الآخر أن تحد على ميت فوق ثلاث إلا على زوج
Muslim narrated it in the Book of Divorce, in the chapter on the obligation of mourning during the waiting period after death and its prohibition beyond that except for three days, hadith no. 64/1490, from the hadith of Yahya bin Saeed, with this chain.