The observation of neutrino oscillations and hence non-zero neutrino masses provided a milestone in the search for physics beyond the Standard Model. But even though we now know that neutrinos are massive, the nature of neutrino masses, i.e., whether they are Dirac or Majorana, remains an open question. A smoking-gun signature of Majorana neutrinos is the observation of neutrinoless double-beta decay, a process that violates the lepton-number conservation of the Standard Model. This white paper focuses on the theoretical aspects of the neutrinoless double-beta decay program and lays out a roadmap for future developments. The roadmap is a multi-scale path starting from high-energy models of neutrinoless double-beta decay all the way to the low-energy nuclear many-body problem that needs to be solved to supplement measurements of the decay rate. The path goes through a systematic effective-field-theory description of the underlying processes at various scales and needs to be supplemented by lattice quantum chromodynamics input. The white paper also discusses the interplay between neutrinoless double-beta decay, experiments at the Large Hadron Collider and results from astrophysics and cosmology in probing simplified models of lepton-number violation at the TeV scale, and the generation of the matter-antimatter asymmetry via leptogenesis. This white paper is prepared for the topical groups TF11 (Theory of Neutrino Physics), TF05 (Lattice Gauge Theory), RF04 (Baryon and Lepton Number Violating Processes), NF03 (Beyond the Standard Model) and NF05 (Neutrino Properties) within the Theory Frontier, Rare Processes and Precision Frontier, and Neutrino Physics Frontier of the U.S. Community Study on the Future of Particle Physics (Snowmass 2021).