A large proportion of patients with cancer are unresponsive to treatment with immune checkpoint blockade and other immunotherapies. Here, we report a mathematical model of the time course of tumour responses to immune checkpoint inhibitors. The model takes into account intrinsic tumour growth rates, the rates of immune activation and of tumour-immune cell interactions, and the efficacy of immune-mediated tumour killing. For 124 patients, four cancer types and two immunotherapy agents, the model reliably described the immune responses and final tumour burden across all different cancers and drug combinations examined. In validation cohorts from four clinical trials of checkpoint inhibitors (with a total of 177 patients), the model accurately stratified the patients according to reduced or increased long-term tumour burden. We also provide model-derived quantitative measures of treatment sensitivity for specific drug-cancer combinations. The model can be used to predict responses to therapy and to quantify specific drug-cancer sensitivities in individual patients.