Whenever the Messenger of Allah ﷺ sat in a gathering or finished praying, he would utter certain words. Ayesha asked him about these words, and he said, "If one has spoken good, these words seal it until the Day of Resurrection, and if one has spoken otherwise, they serve as an expiation for him. The words are, 'Glory be to You, Allah, and praise be to You. I seek Your forgiveness and turn to You in repentance.'"
أن رسول الله ﷺ كان إذا جلس مجلسا أو صلى تكلم بكلمات، فسألته عائشة عن الكلمات، فقال: إن تكلم بخير كان طابعا عليهن إلى يوم القيامة، وإن تكلم بغير ذلك كان كفارة له: سبحانك اللهم وبحمدك أستغفرك وأتوب إليك.
Nasai (1344), Ahmad (24486), and Bayhaqi in Shuab (620) all narrated it through the hadith of Abu Salama Mansur bin Salama Khuzai, who said, Khallad bin Sulayman Hadrami narrated to us, from Khalid bin Abu Imran, from Urwa, from Ayesha, and he related it. Except that in Ahmad's version it appears as Khalid bin Sulayman. Ibn Hajar said in Fath al-Bari (13/545), "Its chain is strong." And he said in Nukat (2/733), "Its chain is sahih."I say, its chain is hasan because of Khalid bin Abu Imran Tujibi, the judge of Ifriqiya, who is among the men of Muslim. Ibn Saad and Ajli deemed him reliable, and Ibn Hibban mentioned him in Thiqat. Abu Hatim said, "There is no harm in him," and someone like him would have his hadith graded sahih if it were outside Sahih [Muslim]. But it is only graded hasan, since Ibn Hajar himself said in Taqrib, "Truthful," and Dhahabi said in Kashif, "Truthful, a jurist, devout worshiper."Nasai added in Kubra (10067): the Messenger of Allah never sat in a gathering, nor recited any part of the Quran, nor performed any prayer, without concluding it with these words... He narrated this from Muhammad bin Sahl bin Askar, who said, Ibn Abu Maryam narrated to us, saying, Khallad bin Sulayman informed us of it. Muhammad bin Sahl bin Askar and his teacher Ibn Abu Maryam, whose name was Saeed bin Hakam bin Muhammad bin Salim bin Abu Maryam, are both reliable.Based on this, Nasai titled the chapter, "Chapter on what the recitation of the Quran is concluded with." So it appears, and Allah knows best, that the Prophet would sometimes say these words when he recited and concluded the Quran, for this has not been established through any chain other than this one.