Zaynab bint Abu Salama reported,

Then I visited Zaynab bint Jahsh when her brother had died. She called for perfume and applied some of it, then said, "I have no need of perfume, except that I heard the Messenger of Allah ﷺ say from the pulpit, 'It is not lawful for a woman who believes in Allah and the Last Day to mourn for anyone who has died for more than three days, except for a husband, for whom it is four months and ten days.'"

Bukhari 1282

Sahih

ثم دخلت على زينب بنت جحش حين توفي أخوها فدعت بطيب فمست به ثم قالت ما لي بالطيب من حاجة غير أني سمعت رسول الله ﷺ على المنبر يقول لا يحل لامرأة تؤمن بالله واليوم الآخر تحد على ميت فوق ثلاث إلا على زوج أربعة أشهر وعشرا

البخاري 1282صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Bukhari
Book
Funerals
Chapter
Mourning of a woman for someone other than her husband
Numbering
Darussalam 1282
Bukhari 1282