Malik related to me from a reliable source of his from Bukayr ibn Abdullah ibn al-Ashajj from Basr ibn Said from Abu Said al-Khudri that Abu Musa al-Ashari said, "The Messenger of Allah ﷺ said, 'One asks permission three times. If you are given permission, then enter. If not, go away.' "
أَنَّهُ قَالَ قَالَ رَسُولُ اللَّهِ ﷺ الاِسْتِئْذَانُ ثَلاَثٌ فَإِنْ أُذِنَ لَكَ فَادْخُلْ وَإِلاَّ فَارْجِعْ