Sayyiduna Abu Humayd Sa'idi (may Allah be pleased with him) or perhaps Sayyiduna Abu Usayd Sa'idi (may Allah be pleased with him) narrates: The Prophet Muhammad (peace and blessings be upon him) said: "When a person comes to the mosque, he should recite: 'O Allah! Open for me the doors of Your mercy.' And when he goes out, he should recite: 'O Allah! I ask You for Your bounty.'"
Hadith Referenceصحیح ابن حبان / كتاب الصلاة / 2049
Hadith Gradingفضيلة الشيخ الإمام محمد ناصر الدين الألبانيصحيح - انظر ما قبله.فضيلة الشيخ العلّامة شُعيب الأرناؤوطإسناده صحيح على شرط مسلم، عبد الله بن سعيد من رجال مسلم، وباقي السند ثقات من رجال الشيخين