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

Umm `Atiyya (Allah be pleased with her) reported that Allah's Messenger (ﷺ) had said:

A woman must not observe mourning for one who had died for more than three (days) except for four months and ten days in the case of her husband. And she must not wear a dyed garment except one of the types made of dyed yarn, or apply collyrium, or touch perfume except a little perfume or incense, when she has been purified after her courses.
وَحَدَّثَنَا حَسَنُ بْنُ الرَّبِيعِ، حَدَّثَنَا ابْنُ إِدْرِيسَ، عَنْ هِشَامٍ، عَنْ حَفْصَةَ، عَنْ أُمِّ عَطِيَّةَ، أَنَّ رَسُولَ اللَّهِ صلى الله عليه وسلم قَالَ ‏ "‏ لاَ تُحِدُّ امْرَأَةٌ عَلَى مَيِّتٍ فَوْقَ ثَلاَثٍ إِلاَّ عَلَى زَوْجٍ أَرْبَعَةَ أَشْهُرٍ وَعَشْرًا وَلاَ تَلْبَسُ ثَوْبًا مَصْبُوغًا إِلاَّ ثَوْبَ عَصْبٍ وَلاَ تَكْتَحِلُ وَلاَ تَمَسُّ طِيبًا إِلاَّ إِذَا طَهُرَتْ نُبْذَةً مِنْ قُسْطٍ أَوْ أَظْفَارٍ ‏"‏ ‏.‏
Reference : Sahih Muslim 938c
In-book reference : Book 18, Hadith 85
USC-MSA web (English) reference : Book 9, Hadith 3550
  (deprecated numbering scheme)