Sunnah.com reference : Book 2, Hadith 316English translation : Book 2, Hadith 406Arabic reference : Book 2, Hadith 411
Narrated Abu Hurairah (RA):
The Prophet (ﷺ) said: "When one of you leads the people in prayer he should be brief, for among them are the young and the old, the weak and those who have needs to attend to. But if he prays by himself he may pray as he wishes."

[Agreed upon].
وَعَنْ أَبِي هُرَيْرَةَ ‏- رضى الله عنه ‏- أَنَّ اَلنَّبِيَّ ‏- صلى الله عليه وسلم ‏-قَالَ: { إِذَا أَمَّ أَحَدُكُمْ اَلنَّاسَ فَلْيُخَفِّفْ, فَإِنَّ فِيهِمْ اَلصَّغِيرَ وَالْكَبِيرَ وَالضَّعِيفَ وَذَا اَلْحَاجَةِ, فَإِذَا صَلَّى وَحْدَهُ فَلْيُصَلِّ كَيْفَ شَاءَ }  مُتَّفَقٌ عَلَيْه ِ  1‏ .‏‏1 ‏- صحيح.‏ رواه البخاري (703)‏، ومسلم (467)‏.‏