كتاب الطلاق
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 1490 a

Safiyya bint Abu 'Ubaid reported on the authority of Hafsa or 'A'isha (Allah be pleased with thein) or from both of them that Allah's Messenger (may peace he upon him) said:

It is not permissible for a woman believing in Allah and the Hereafter (or believing in Allah and His Messenger) that she should observe mourning for the dead beyond three days except in case of her husband.
وَحَدَّثَنَا يَحْيَى بْنُ يَحْيَى، وَقُتَيْبَةُ، وَابْنُ، رُمْحٍ عَنِ اللَّيْثِ بْنِ سَعْدٍ، عَنْ نَافِعٍ، أَنَّ صَفِيَّةَ، بِنْتَ أَبِي عُبَيْدٍ حَدَّثَتْهُ عَنْ حَفْصَةَ، أَوْ عَنْ عَائِشَةَ، أَوْ عَنْ كِلْتَيْهِمَا، أَنَّ رَسُولَ اللَّهِ صلى الله عليه وسلم قَالَ ‏ "‏ لاَ يَحِلُّ لاِمْرَأَةٍ تُؤْمِنُ بِاللَّهِ وَالْيَوْمِ الآخِرِ - أَوْ تُؤْمِنُ بِاللَّهِ وَرَسُولِهِ - أَنْ تُحِدَّ عَلَى مَيِّتٍ فَوْقَ ثَلاَثَةِ أَيَّامٍ إِلاَّ عَلَى زَوْجِهَا ‏"‏ ‏.‏
Reference : Sahih Muslim 1490a
In-book reference : Book 18, Hadith 80
USC-MSA web (English) reference : Book 9, Hadith 3545
  (deprecated numbering scheme)