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.
حدثنا عمر بن إسمعيل بن مجالد حدثني أبي عن بيان
بنى رسول الله ﷺ بامرأة من نسائه فأرسلني فدعوت قوما إلى الطعام فلما أكلوا وخرجوا قام رسول الله ﷺ منطلقا قبل بيت عائشة فرأى رجلين جالسين فانصرف راجعا قام الرجلان فخرجا فأنزل الله عز وجل {يا أيها الذين آمنوا لا تدخلوا بيوت النبي إلا أن يؤذن لكم إلى طعام غير ناظرين إناه} وفي الحديث قصة
[Sahih] Bukhari also narrated it in the Book of Marriage, chapter on the wedding feast even if only with a sheep, hadith no. 5170, from the hadith of Bayan, in abridged form.Hadith of Thabit from Anas, Muslim also narrated it, hadith no. 1428, in full.