The Prophet ﷺ said, "When one of you leads people in prayer, let him keep it brief, for among them are the weak, the sick, and the elderly. But when he prays alone, let him prolong it as much as he wishes."
حدثنا القعنبي عن مالك عن أبي الزناد عن الأعرج
أن النبي ﷺ قال إذا صلى أحدكم للناس فليخفف فإن فيهم الضعيف والسقيم والكبير وإذا صلى لنفسه فليطول ما شاء
Bukhari narrated it in the Book of Adhan, chapter "If he prays alone, he may lengthen it as much as he wishes," no. 703, from the hadith of Malik, through this route, and it is found in Muwatta (Yahya) 134.