Prolonged hospital stay after surgery is an important patient-centred outcome in older patients and is associated with increased healthcare costs. This case–control study aimed to identify risk factors for prolonged hospital stay in older patients having surgery. We matched 57 cases (patients 65 years of age or older, with a postoperative length of stay of greater than 21 days) with 165 controls (patients 65 years of age or older who underwent a comparable surgical procedure but were discharged home within 14 days). Patients had a greater risk of prolonged hospital stay if they had a history of cognitive impairment (odds ratio (OR) 2.41, 95% confidence interval (CI) 1.10 to 5.28, P =0.025), lung disease (OR 2.41, 95% CI 1.30 to 4.46, P =0.005) or past or current smoking (OR 1.58, 95% CI 1.14 to 2.19, P =0.009). Patients were also more likely to have longer hospital admission if they underwent emergency surgery (OR 1.26, 95% CI 1.12 to 1.41, P =0.002), were admitted to the intensive care unit (OR 4.57, 95% CI 2.80 to 7.56, P <0.001), had a blood transfusion (OR 4.83, 95% CI 2.92 to 7.96, P <0.001) or had any postoperative complication (OR 4.34, 95% CI 3.06 to 6.16, P <0.001). There were no significant differences in age, preoperative mobility status, or living arrangements between groups. In practice, these findings should assist clinicians and their patients in preoperative shared decision-making.