Sunan an-Nasa'i, Book 10, Hadith 47 (In-Book)

It was narrated from Abu Hurairah that the Prophetsaid: "When any one of you leads the people in prayer, let him make it short, for among them are the sick, the weak and the elderly. And when any one of you prays by himself, let him make it as long as he wishes."

أَخْبَرَنَا قُتَيْبَةُ، عَنْ مَالِكٍ، عَنْ أَبِي الزِّنَادِ، عَنِ الأَعْرَجِ، عَنْ أَبِي هُرَيْرَةَ، عَنِ النَّبِيِّ صلى الله عليه وسلم قَالَ ‏ "‏ إِذَا صَلَّى أَحَدُكُمْ بِالنَّاسِ فَلْيُخَفِّفْ فَإِنَّ فِيهِمُ السَّقِيمَ وَالضَّعِيفَ وَالْكَبِيرَ فَإِذَا صَلَّى أَحَدُكُمْ لِنَفْسِهِ فَلْيُطَوِّلْ مَا شَاءَ ‏" ‏ ‏.‏

sunnah.com