Immune checkpoint inhibitors (ICI) are becoming widely used for treatment of metastatic melanoma. However, prediction of the individual benefit of patients from these therapeutics remains an unmet clinical need. Mathematical models that predict melanoma patients' response to ICI can contribute to better informed clinical decisions. Here, we developed a simple ODE-based mathematical population model for pembrolizumab-treated advanced melanoma patients, and analyzed the local and global dynamics of the system. Our results show that zero, one, or two steady states of the mathematical system exist in the phase plane, depending on the parameter values of individual patients. Without treatment, the simulated tumors grew uncontrollably. At increased efficacy of the immune system, i.e. due to immunotherapy, two steady states were found, one leading to uncontrollable tumor growth, whereas the other resulted in tumor size stabilization. The model analysis indicates that a sufficient increase in the activation of CD8+ T cells results in stable disease, whereas a significant reduction in T-cell exhaustion, another process contributing CD8+ T cell activity, entails a temporal reduction in the tumor mass, but fails to control disease progression in the long run. Importantly, the initial tumor burden influences the in-treatment dynamics: small tumors responded better to treatment than larger tumors. In conclusion, our model suggests that disease progression and response to ICI depend on the ratio between activation and exhaustion rates of CD8+ T cells. The model analysis provides a foundation for the use of computational methods to personalize immunotherapy.