Importance: Persons with immune dysfunction have a higher risk for severe COVID-19 outcomes. However, these patients were largely excluded from SARS-CoV-2 vaccine clinical trials, creating a large evidence gap. Objective: To identify the incidence rate and incidence rate ratio (IRR) for COVID-19 breakthrough infection after SARS-CoV-2 vaccination among persons with or without immune dysfunction. Design, Setting, and Participants: This retrospective cohort study analyzed data from the National COVID Cohort Collaborative (N3C), a partnership that developed a secure, centralized electronic medical record-based repository of COVID-19 clinical data from academic medical centers across the US. Persons who received at least 1 dose of a SARS-CoV-2 vaccine between December 10, 2020, and September 16, 2021, were included in the sample. Main Outcomes and Measures: Vaccination, COVID-19 diagnosis, immune dysfunction diagnoses (ie, HIV infection, multiple sclerosis, rheumatoid arthritis, solid organ transplant, and bone marrow transplantation), other comorbid conditions, and demographic data were accessed through the N3C Data Enclave. Breakthrough infection was defined as a COVID-19 infection that was contracted on or after the 14th day of vaccination, and the risk after full or partial vaccination was assessed for patients with or without immune dysfunction using Poisson regression with robust SEs. Poisson regression models were controlled for a study period (before or after [pre- or post-Delta variant] June 20, 2021), full vaccination status, COVID-19 infection before vaccination, demographic characteristics, geographic location, and comorbidity burden. Results: A total of 664722 patients in the N3C sample were included. These patients had a median (IQR) age of 51 (34-66) years and were predominantly women (n = 378307 [56.9%]). Overall, the incidence rate for COVID-19 breakthrough infection was 5.0 per 1000 person-months among fully vaccinated persons but was higher after the Delta variant became the dominant SARS-CoV-2 strain (incidence rate before vs after June 20, 2021, 2.2 [95% CI, 2.2-2.2] vs 7.3 [95% CI, 7.3-7.4] per 1000 person-months). Compared with partial vaccination, full vaccination was associated with a 28% reduced risk for breakthrough infection (adjusted IRR [AIRR], 0.72; 95% CI, 0.68-0.76). People with a breakthrough infection after full vaccination were more likely to be older and women. People with HIV infection (AIRR, 1.33; 95% CI, 1.18-1.49), rheumatoid arthritis (AIRR, 1.20; 95% CI, 1.09-1.32), and solid organ transplant (AIRR, 2.16; 95% CI, 1.96-2.38) had a higher rate of breakthrough infection. Conclusions and Relevance: This cohort study found that full vaccination was associated with reduced risk of COVID-19 breakthrough infection, regardless of the immune status of patients. Despite full vaccination, persons with immune dysfunction had substantially higher risk for COVID-19 breakthrough infection than those without such a condition. For persons with immune dysfunction, continued use of nonpharmaceutical interventions (eg, mask wearing) and alternative vaccine strategies (eg, additional doses or immunogenicity testing) are recommended even after full vaccination.