The phenomenon of quasi-periodic pulsations (QPPs) in solar and stellar flares has been known for over 50 years and significant progress has been made in this research area. It has become clear that QPPs are not rare—they are found in many flares and, therefore, robust flare models should reproduce their properties in a natural way. At least fifteen mechanisms/models have been developed to explain QPPs in solar flares, which mainly assume the presence of magnetohydrodynamic (MHD) oscillations in coronal structures (magnetic loops and current sheets) or quasi-periodic regimes of magnetic reconnection. We review the most important and interesting results on flare QPPs, with an emphasis on the results of recent years, and we present the predicted and prominent observational signatures of each of the fifteen mechanisms. However, it is not yet possible to draw an unambiguous conclusion as to the correct underlying QPP mechanism because of the qualitative, rather than quantitative, nature of most of the models and also due to insufficient observational information on the physical properties of the flare region, in particular the spatial structure of the QPP source. We also review QPPs in stellar flares, where progress is largely based on solar-stellar analogies, suggesting similarities in the physical processes in flare regions on the Sun and magnetoactive stars. The presence of QPPs with similar properties in solar and stellar flares is, in itself, a strong additional argument in favor of the likelihood of solar-stellar analogies. Hence, advancing our understanding of QPPs in solar flares provides an important additional channel of information about stellar flares. However, further work in both theory/simulations and in observations is needed.