"The Messenger of Allah (ﷺ) was staying with one of his wives, so he sent me to invite people for a meal. When they ate and left, the Messenger of Allah (ﷺ) stood and went off in the direction of 'Aishah's house. He saw two men (still) sitting, so he turned to come back, then the two men stood up to leave. So Allah revealed: 'O you who believe! Do not enter the Prophet's house unless permission is given to you for a meal, not to wait for its preparation (33:53)." And there is a long story with the narration.
Jami` at-Tirmidhi Book 47, Hadith 271