Viral latency is a major barrier to curing HIV infection with antiretroviral therapy, and consequently, for eliminating the disease globally. The establishment, maintenance, and potential clearance of latent infection are complex dynamic processes and can be best understood and described with the help of mathematical models. Here we review the use of viral dynamics models for HIV, with a focus on applications to the latent reservoir. Such models have been used to explain the multiphasic decay of viral load during antiretroviral therapy, the early seeding of the latent reservoir during acute infection and the limited inflow during treatment, the dynamics of viral blips, and the phenomenon of posttreatment control. In addition, mathematical models have been used to predict the efficacy of potential HIV cure strategies, such as latency-reversing agents, early treatment initiation, or gene therapies, and to provide guidance for designing trials of these novel interventions.