This study aimed to investigate the association between sociodemographic and behavioral factors and obesity from 2014 to 2021 in adults in São Paulo city, Brazil. A prospective study was carried out with 1,241 adults aged 18 years or above who lived in São Paulo and participated in the São Paulo Health Survey cohort (ISA) - Physical Activity and Environment. The outcome was obesity (yes/no), classified by body mass index and specific cut-off points for each age group. The exposure variables included sex, age, education, skin color, marital status, regional health coordination, physical activity in the four domains, and sedentary behaviors. Multilevel logistic regression models were used for longitudinal analysis. This study found a significant increase (27.7%) in the prevalence of obesity (from 22.6% to 28.9%). People who practiced at least 150 minutes of leisure-time physical activity per week (OR = 0.44; 95%CI: 0.26; 0.76), between 10 and 150 minutes per week of commuting physical activity (OR = 0.49; 95%CI: 0.30; 0.80), and had no partner (OR = 0.47; 95%CI: 0.28; 0.78) were less likely to be obese. People aged from 40 to 59 years (OR = 5.00; 95%CI: 2.02; 12.38) and who were black (OR = 4.70; 95%CI: 1.85; 11.95) were more likely to be obese. This study found an increase in the prevalence of obesity during the studied period, with increased odds for middle-aged and black people and decreased odds for those without a partner and those who practice physical activities in their leisure and as a form of commuting. These results can contribute to support programs and policies to control obesity.