Objectives: The influence of comorbidity on long-term hospitalization and mortality after COVID-19 in adults (40–59 years) and older adults (≥60 years) is yet to be explored. Methods: This is a Danish population-based cohort study of patients with a first-time positive PCR test for COVID-19 from 1 March 2020, to 28 February 2022 (N = 1,034,103). Exposed cohorts were patients with 1) a Charlson Comorbidity Index (CCI) score of 1–2 and 2) a CCI score ≥3, who were compared to patients without comorbidity (CCI of zero) within the groups of adults (67.9%) and older adults (32.1%) for the risk of hospitalization and mortality. Next, within the age groups, each disease category of the CCI was considered as an exposed cohort and compared to patients who did not have the specific disease of interest. Adjusted hazard ratios (HR) for hospitalization and mortality were estimated by Cox regression models adjusted for confounders. Results: The highest HRs were in adult patients with a CCI score of ≥3. The adjusted HR was 4.54 (95%CI: 4.38–4.70) for hospitalization, and among older adults it was 3.05 (95%CI: 2.99–3.11). The adjusted HR for mortality among adults with a CCI score ≥3 was 21.04 (95%CI: 18.86–23.47), and the adjusted HR for mortality among older adults was 4.61 (95%CI: 4.44–4.78). The underlying disease influenced the risk estimates among adults and older adults, and “dementia” had the highest impact on mortality. Conclusion: A CCI score of 1 or above increases the risk of hospitalization and mortality up to 2 years after a positive PCR test of COVID-19 for adults and older adults. Further, the type of underlying disease in older adults highly influences the risk of hospitalization and mortality.