While the development of different vaccines has slowed the dissemination of SARS-CoV-2, the occurrence of breakthrough infections continues to fuel the pandemic. As a strategy to secure at least partial protection, with a single dose of a given COVID-19 vaccine to maximum possible fraction of the population, delayed administration of subsequent doses (or boosters) has been implemented in many countries. However, waning immunity and emergence of new variants of SARS-CoV-2 suggest that such measures may jeopardize the attainment of herd immunity due to intermittent lapses in protection. Optimizing vaccine dosing schedules could thus make the difference between periodic occurrence of breakthrough infections or effective control of the pandemic. To this end, we have developed a mechanistic mathematical model of adaptive immune response to vaccines and demonstrated its applicability to COVID-19 mRNA vaccines as a proof-of-concept for future outbreaks. The model was thoroughly calibrated against multiple clinical datasets involving immune response to SARS-CoV-2 infection and mRNA vaccines in healthy and immunocompromised subjects (cancer patients undergoing therapy); the model showed robust clinical validation by accurately predicting neutralizing antibody kinetics, a correlate of vaccine-induced protection, in response to multiple doses of mRNA vaccines. Importantly, we estimated population vulnerability to breakthrough infections and predicted tailored vaccination dosing schedules to maximize protection and thus minimize breakthrough infections, based on the immune status of a sub-population. We have identified a critical waiting window for cancer patients (or, immunocompromised subjects) to allow recovery of the immune system (particularly CD4+ T-cells) for effective differentiation of B-cells to produce neutralizing antibodies and thus achieve optimal vaccine efficacy against variants of concern, especially between the first and second doses. Also, we have obtained optimized dosing schedules for subsequent doses in healthy and immunocompromised subjects, which vary from the CDC-recommended schedules, to minimize breakthrough infections. The developed modeling tool is based on generalized adaptive immune response to antigens and can thus be leveraged to guide vaccine dosing schedules during future outbreaks.