We investigated the effects of gender and lifestyle on the association between frequency of depressive symptoms and CVD risk. The UK Biobank is a national prospective cohort study that recruited 502,505 participants aged 40–69 years between 2006 and 2010. Participants without CVD were classified as having low, moderate, high, or very high frequency of depressive symptoms according to the number of days they felt depressed in a 2-week period. UKBB data include self-reported questionnaires covering lifestyle behaviors such as smoking, physical activity, eating habits, and sleep duration. The primary outcomes included incident CVD including coronary artery disease, ischemic stroke, hemorrhagic stroke, peripheral artery disease, atrial fibrillation/flutter, and heart failure. Cox proportional hazard models were used to evaluate the effects of gender and lifestyle on the association of frequency of depressive symptoms and CVD risk. During a median follow-up of 8.9 years, 27,394 (6.3%) developed CVD. The frequency of depressive symptoms increased the risk of CVD according to low, moderate, high, and very high frequency of depressive symptoms (Pfor trend < 0.001). The adjusted CVD risk was 1.38-fold higher for participants with very high frequency of depressive symptoms compared to those with low frequency of depressive symptoms (HR 1.38, 95% CI 1.24–1.53,P< 0.001). The correlation between frequency of depressive symptoms and CVD risk was more remarkable in females than in males. In participants with high or very high frequency of depressive symptoms, the individual lifestyle factors of no current smoking, non-obesity, non-abdominal obesity, regular physical activity, and appropriate sleep respectively was associated with lower CVD risk by 46% (HR 0.54, 95% CI 0.48–0.60,P< 0.001), 36% (HR 0.64, 95% CI 0.58–0.70,P< 0.001), 31% (HR 0.69, 95% CI 0.62–0.76,P< 0.001), 25% (HR 0.75, 95% CI 0.68–0.83,P< 0.001), and 22% (HR 0.78, 95% CI 0.71–0.86,P< 0.001). In this large prospective cohort study, a higher frequency of depressive symptoms at baseline was significantly associated with increased risk of CVD in the middle-aged population, and this relationship was prominent in women. In the middle-aged population with depressive symptoms, engaging in a healthier lifestyle could prevent CVD risk.