Kaab bin Malik reported,

He narrated this when he had stayed behind from Tabuk and the Messenger of Allah ﷺ had forbidden anyone from speaking to us. I would come to the Messenger of Allah ﷺ and greet him with salaam, asking myself whether he had moved his lips to return the greeting or not, until fifty nights had passed. Then the Prophet ﷺ announced that Allah had accepted our repentance, after he had finished the Fajr prayer.

Bukhari 6255

Sahih

حدثنا ابن بكير حدثنا الليث عن عقيل عن ابن شهاب عن عبد الرحمن بن عبد الله بن كعب أن عبد الله بن كعب قال سمعت

كعب بن مالك

يحدث حين تخلف عن تبوك ونهى رسول الله ﷺ عن كلامنا وآتي رسول الله ﷺ فأسلم عليه فأقول في نفسي هل حرك شفتيه برد السلام أم لا حتى كملت خمسون ليلة وآذن النبي ﷺ بتوبة الله علينا حين صلى الفجر

البخاري 6255صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Bukhari
Book
Permission to enter
Chapter
Not greeting one who has committed a sin and not returning his greeting until his repentance becomes clear, and how long until the repentance of the disobedient one becomes clear
Numbering
Darussalam 6255
Bukhari 6255