He also reported God’s Messenger as saying, “A man's prayer in company is twenty-five times as valuable as his prayer in his house and his market, for when he performs ablution, doing it well, then goes out to the mosque, having no other reason than prayer for going out, he does not take a step without being raised a degree for it and having a sin remitted for it, and when he prays the angels continue to invoke blessings on him as long as he is in his place of prayer, saying, ‘God bless him; God show mercy to him.’ And each of you continues to be engaged in prayer as long as he is waiting for the prayer.” In a version he said, “When he enters the mosque prayer holds him fast.” And he added in the invocation of the angels, “O God, forgive him, O God, turn towards him, as long as he does not do any harm in it and as long as he does not do anything unseemly in it.”
Narrated Abu Huraira reported God’s Messenger as saying, “There are seven whom God will cover with His shade on the day when there will be no shade but His:
a just imam; a young man who grows up worshipping God; a man whose heart is attached to the mosque from the time he leaves it till he returns to it; two men who love one another for God's sake, meeting thus and separating thus; a man who remembers God in solitude, his eyes pouring forth tears; a man who, when accosted by a woman of rank and beauty, says, ‘I fear God’; and a man who gives alms concealing it so that his left hand does not know what his right hand bestows.”
Narrated Abu Usaid reported God's Messenger as saying:
When any of you enters the mosque he should say, “O God, open to me the gates of Thy mercy, “and when he goes out he should say “O God, I ask Thee out of Thine abundance.”
Jabir said that the area round the mosque was vacant and that the Banu Salima wanted to move near the mosque, but when the Prophet heard of that he said to them, “I have heard that you want to move near the mosque.” They replied, “Yes, Messenger of God, that was our desire.” He said, “Banu Salima, if you keep to your present houses, your footprints will be recorded; if you keep to your present houses, your footprints will be recorded.”*
* I.e. you will receive a reward for the distance you have to go to the mosque.
Muslim transmitted it.