كتاب الطلاق
18  
The Book of Divorce
(9)
Chapter: The Obligation to mourn during the 'Iddah following the death of one's husband, but it is forbidden to mourn for more than three days in other cases
(9)
باب وُجُوبِ الإِحْدَادِ فِي عِدَّةِ الْوَفَاةِ وَتَحْرِيمِهِ فِي غَيْرِ ذَلِكَ إِلاَّ ثَلاَثَةَ أَيَّامٍ
Sahih Muslim 1486 b

Zainab bint Umm Salama (Allah be pleased with her) reported that a relative of Umm Habiba (Allah he pleased with her) died. She sent for a yellow (perfume) and applied that to her forearm and said:

I, am doing it, for I have heard Allah's Messenger (ﷺ) saying: It is not permissible for a woman believing in Allah and the Hereafter to mourn beyond three days except the husband (for whom she can mourn) for four months and ten days.
وَحَدَّثَنَا مُحَمَّدُ بْنُ الْمُثَنَّى، حَدَّثَنَا مُحَمَّدُ بْنُ جَعْفَرٍ، حَدَّثَنَا شُعْبَةُ، عَنْ حُمَيْدِ بْنِ نَافِعٍ، قَالَ سَمِعْتُ زَيْنَبَ بِنْتَ أُمِّ سَلَمَةَ، قَالَتْ تُوُفِّيَ حَمِيمٌ لأُمِّ حَبِيبَةَ فَدَعَتْ بِصُفْرَةٍ فَمَسَحَتْهُ بِذِرَاعَيْهَا وَقَالَتْ إِنَّمَا أَصْنَعُ هَذَا لأَنِّي سَمِعْتُ رَسُولَ اللَّهِ صلى الله عليه وسلم يَقُولُ ‏ "‏ لاَ يَحِلُّ لاِمْرَأَةٍ تُؤْمِنُ بِاللَّهِ وَالْيَوْمِ الآخِرِ أَنْ تُحِدَّ فَوْقَ ثَلاَثٍ إِلاَّ عَلَى زَوْجٍ أَرْبَعَةَ أَشْهُرٍ وَعَشْرًا ‏"‏ ‏.‏
Reference : Sahih Muslim 1486b
In-book reference : Book 18, Hadith 74
USC-MSA web (English) reference : Book 9, Hadith 3540
  (deprecated numbering scheme)