The Messenger of Allah ﷺ said, "A man's prayer in congregation is multiplied twenty-five times over his prayer at home or in his marketplace. That is because when he performs ablution well, then sets out for the mosque with nothing but prayer driving him forth, he takes no step except that by it he is raised one degree and one sin is wiped away from him. When he prays, the angels continue to invoke blessings upon him as long as he remains at his place of prayer, saying, 'Allah, send blessings upon him. Allah, have mercy on him.' And each of you remains in prayer as long as he is waiting for the prayer."
قال رسول الله ﷺ: صلاة الرجل في الجماعة تضعف على صلاته في بيته، وفي سوقه خمسا وعشرين ضعفا، وذلك أنه إذا توضأ فأحسن الوضو، ثم خرج إلى المسجد، لا يخرجه إلا الصلاة، لم يخط خطوة إلا رفعت له بها درجة، وحط عنه بها خطيئة، فإذا صلى لم تزل الملائكة تصلي عليه ما دام في مصلاه. اللهم صل عليه، اللهم ارحمه، ولا يزال أحدكم في صلاة ما انتظر الصلاة.
Bukhari narrated it in the Book of Adhan (647), and this is his wording, and Muslim narrated it in the Book of Mosques (649), both of them from Amash, who said, I heard Abu Salih say, I heard Abu Hurairah, and he mentioned the hadith. Muslim added, "As long as he does not cause harm in it, and as long as he does not commit a wrongdoing in it."