From Sahih Bukhari (Hadith 703):
Narrated Abu Huraira:Allah's Messenger (ﷺ) said, "If anyone of you leads the people in the prayer, he should shorten it for amongst them are the weak, the sick and the old; and if anyone among you prays alone then he may prolong (the prayer) as much as he wishes
Reference: Bukhari 703