(1) Background: The purpose of the study was to evaluate the associations between physical activity (PA), sunshine duration (SD) and the occurrence of osteoporosis according to lifestyle status. (2) Methods: Data from the Korean National Health Insurance Service–National Sample Cohort (NHIS-NSC) collected from 2009 to 2015 were used. Osteoporosis (n = 19,351) and control (n = 38,702) participants were matched in a 1:2 ratio according to age, sex, income, and region of residence. PA was classified as moderate- to high-intensity PA (MHPA) or low-intensity PA (LPA) based on the International Physical Activity Questionnaire (IPAQ). SD was classified as short (≤6 h) or long (>6 h). Conditional logistic regression was used to calculate the odds ratios (ORs) with 95% confidence intervals (CIs) of MHPA and long SD for the occurrence of osteoporosis. Subgroup analyses were performed according to SD (or PA), obesity, smoking, and alcohol consumption. (3) The adjusted OR of MHPA for osteoporosis was 0.90 (95% CI = 0.87–0.94). The results were consistent in the age/sex, SD, obesity, smoking, and alcohol consumption subgroups, but not the <60-year-old male and underweight subgroups. The adjusted OR of long SD for osteoporosis was 0.96 (95% CI = 0.93–1.00). The findings were consistent in the <60-year-old female, obese, nonsmoker, and <1 time a week alcohol consumption subgroups. (4) Conclusions: We suggest that both higher intensity of PA and long SD could decrease the risk of osteoporosis. Specifically, PA could decrease the risk of osteoporosis in individuals with most characteristics except male sex or underweight. Long SD could decrease the risk of osteoporosis in young females, obese individuals, nonsmokers, and individuals with lower alcohol consumption.