Investigations on gender variations in the risk factors of cognitive impairment are required to promote future precision medicine among older adults, as well as to contribute to a better understanding of the “male–female health-survival paradox”. With this study, we aimed to investigate the effects of “diet–smoking–gender” three-way interactions on cognitive impairments among Chinese older adults. We conducted a 16-year prospective cohort study among 15,953, 15,555, 16,849, 9716, 7116, and 13,165 older adults from the 2002, 2005, 2008–2009, 2011–2012, 2014, and 2017–2018 waves of the Chinese Longitudinal Healthy Longevity Survey (CLHLS), respectively. Cognitive impairment was measured by the Mini-Mental State Examination (MMSE). The dietary diversity score (DDS) was calculated using the CLHLS food frequency questionnaire. Generalized estimating equations (GEE) were used to assess the “diet–smoking–gender” three-way interaction effects on cognitive impairment across the six waves of CLHLS. We found that higher dietary diversity was associated with lower probability of cognitive impairment among older adults (OR = 0.92; 95%CI = 0.90, 0.98). However, smoking behavior may negatively influence the protective effect of higher dietary diversity on cognitive function among females (OR = 1.26; 95%CI = 1.07, 1.49). Our findings imply that we should take gender differences and lifestyle behaviors into consideration in implementing dietary interventions to improve cognitive function among older adults.