Meaning: O Allaah, open the doors of Your Mercy for me.
When leaving the Masjid, one should recite the following Du'aa: اللهم انى اسالك من فضلك
Transliteration: Allaahumma In-nee As`aluka Min Fadhlika.
Meaning: O Allaah, I seek of You Your Grace.
Faatimah (RA) reported that when Allah’s Messenger (Sallallahu Alaihi Wasallam) entered the Masjid, he invoked blessings and peace upon Muhammad (himself) and then said: “My Lord, forgive my sins and open unto me the gates of Your Mercy.” And as he went out of the Masjid, he would supplicate for blessings and peace upon Muhammad (himself) and say: “My Lord, forgive my sins and open unto me the doors of Your Bounty.” (Muslim, Mishkaat, Chapter: of Masjid and the places of Salah.)