The aim of this study is to evaluate the relationship between the density of green spaces at different buffer sizes (300, 500, 1000 and 1500 m) and cardiovascular risk factors (obesity, hypertension, high cholesterol, and diabetes) as well as to study if the relationship is different for males and females. We conducted cross-sectional analyses using the baseline measures of the Heart Healthy Hoods study (N = 1625). We obtained data on the outcomes from clinical diagnoses, as well as anthropometric and blood sample measures. Exposure data on green spaces density at different buffer sizes were derived from the land cover distribution map of Madrid. Results showed an association between the density of green spaces within 300 and 500 m buffers with high cholesterol and diabetes, and an association between the density of green spaces within 1500 m buffer with hypertension. However, all of these associations were significant only in women. Study results, along with other evidence, may help policy-makers creating healthier environments that could reduce cardiovascular disease burden and reduce gender health inequities. Further research should investigate the specific mechanisms behind the differences by gender and buffer size of the relationship between green spaces and cardiovascular risk factors.