كتاب الطلاق
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 c, 1488 e

Zainab bint Abu Salama reported:

Umm Salama and Umm Habiba (Allah be pleased with them) were talking with each other (and saying) that a woman came to Allah's Messenger (ﷺ) and mentioned to him that her daughter had lost her husband, and her eyes were sore and she wanted to use collyrium, whereupon Allah's Messenger (ﷺ) said: One among you used to throw dung at the end of a year, and now (this abstinence from adornment) is only for four months and ten days.
وَحَدَّثَنَا أَبُو بَكْرِ بْنُ أَبِي شَيْبَةَ، وَعَمْرٌو النَّاقِدُ، قَالاَ حَدَّثَنَا يَزِيدُ بْنُ هَارُونَ، أَخْبَرَنَا يَحْيَى بْنُ سَعِيدٍ، عَنْ حُمَيْدِ بْنِ نَافِعٍ، أَنَّهُ سَمِعَ زَيْنَبَ بِنْتَ أَبِي سَلَمَةَ، تُحَدِّثُ عَنْ أُمِّ سَلَمَةَ، وَأُمِّ حَبِيبَةَ تَذْكُرَانِ أَنَّ امْرَأَةً أَتَتْ رَسُولَ اللَّهِ صلى الله عليه وسلم فَذَكَرَتْ لَهُ أَنَّ بِنْتًا لَهَا تُوُفِّيَ عَنْهَا زَوْجُهَا فَاشْتَكَتْ عَيْنُهَا فَهْىَ تُرِيدُ أَنْ تَكْحُلَهَا فَقَالَ رَسُولُ اللَّهِ صلى الله عليه وسلم ‏ "‏ قَدْ كَانَتْ إِحْدَاكُنَّ تَرْمِي بِالْبَعَرَةِ عِنْدَ رَأْسِ الْحَوْلِ وَإِنَّمَا هِيَ أَرْبَعَةُ أَشْهُرٍ وَعَشْرٌ ‏"‏ ‏.‏
Reference : Sahih Muslim 1486c, 1488e
In-book reference : Book 18, Hadith 78
USC-MSA web (English) reference : Book 9, Hadith 3543
  (deprecated numbering scheme)