This cohort study uses data from the Health and Retirement Study and Medicare claims to examine the association between loneliness and postoperative mortality after elective vs nonelective surgery among older adults.