BackgroundAlthough depression is associated with poor treatment outcomes in patients with cancer, little is known about whether lifestyle modifications could help prevent depression. The authors aimed to identify the effect of lifestyle modifications, including smoking cessation, alcohol abstinence, and starting regular physical activity, on new‐onset depression in patients with gastric cancer who underwent surgery.MethodsBy using the Korean National Health Insurance Service database, patients with gastric cancer who underwent surgery between 2010 and 2017 were identified. Self‐reported lifestyle behaviors within 2 years before and after surgery were analyzed using the health examination database. Patients were classified according to changes in lifestyle behaviors, and their risk of new‐onset depression was compared.ResultsAmong 18,902 patients, 2302 (12.19%) developed depression (26.00 per 1000 person‐years). Smoking cessation (hazard ratio [HR], 0.77; 95% confidence interval [CI], 0.66–0.91) and alcohol abstinence (HR, 0.79; 95% CI, 0.69–0.90) were associated with reduced risk of depression development compared with persistent smoking and persistent drinking, respectively. Starting regular physical activity was not associated with risk of depression. When lifestyle behaviors after gastrectomy were scored from 0 to 3 points (1 point each for not smoking, not drinking, and being physically active), the risk of depression tended to decrease as lifestyle scores increased from 0 points (reference) to 1 point (HR, 0.69; 95% CI, 0.55–0.83), 2 points (HR, 0.60; 95% CI, 0.50–0.76), and 3 points (HR, 0.55; 95% CI, 0.45–0.68).ConclusionsSmoking cessation and alcohol abstinence are associated with reduced risk of developing depression in patients with gastric cancer who undergo surgery.