Anas bin Malik reported,

The Messenger of Allah ﷺ consummated his marriage with one of his wives, and he sent me to invite some people to the meal. When they had eaten and left, the Messenger of Allah ﷺ got up and headed toward Ayesha's house, but he saw two men still sitting there, so he turned back. The two men then got up and left, and Allah عز وجل revealed, "Believers, do not enter the houses of the Prophet unless permission is given to you for a meal, without waiting for it to be prepared" [Ahzab 33:53]. The hadith contains a longer account.

Tirmidhi 3219

Sahih

حدثنا عمر بن إسمعيل بن مجالد حدثني أبي عن بيان

عن أنس بن مالك رضي الله عنه قال

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

الترمذي 3219صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami Tirmidhi
Book
Tafsir of the Quran
Chapter
From Surah Ahzab
Numbering
Darussalam 3219
Tirmidhi 3219