Sunan an-Nasa'i, Book 27, Hadith 115 (In-Book)

It was narrated from Safiyyah bint Abi 'Ubaid that she heard Hafsah bint 'Umar, the wife of the Prophet, (narrate) that the Prophet said: "It is not permissible for a woman who believes in Allah and the Last Day to mourn for anyone who dies for more than three days except for a husband; she should mourn for him for four months and ten (days)."

أَخْبَرَنَا مُحَمَّدُ بْنُ بَشَّارٍ، قَالَ حَدَّثَنَا عَبْدُ الْوَهَّابِ، قَالَ سَمِعْتُ نَافِعًا، يَقُولُ عَنْ صَفِيَّةَ بِنْتِ أَبِي عُبَيْدٍ، أَنَّهَا سَمِعَتْ حَفْصَةَ بِنْتَ عُمَرَ، زَوْجَ النَّبِيِّ صلى الله عليه وسلم عَنِ النَّبِيِّ صلى الله عليه وسلم قَالَ ‏ "‏ لاَ يَحِلُّ لاِمْرَأَةٍ تُؤْمِنُ بِاللَّهِ وَالْيَوْمِ الآخِرِ تَحِدُّ عَلَى مَيِّتٍ فَوْقَ ثَلاَثٍ إِلاَّ عَلَى زَوْجٍ فَإِنَّهَا تَحِدُّ عَلَيْهِ أَرْبَعَةَ أَشْهُرٍ وَعَشْرًا ‏" ‏ ‏.‏

sunnah.com