Nafi' bin Jubayr (may Allah have mercy on him) narrates from his father, Sayyiduna Jubayr bin Mut'im (may Allah be pleased with him), who said: the Messenger of Allah (peace and blessings be upon him) said: "Whoever says: 'Glory be to Allah and with His praise; glory be to You, O Allah, and with Your praise; I bear witness that there is no deity except You; I seek Your forgiveness and I repent to You,' and says it in a gathering of remembrance, it becomes like a seal upon it; and whoever says it in a gathering of idle talk, it becomes an expiation for him."
Hadith Referenceالمعجم الكبير للطبراني / باب الجيم / 1573