This is (mainly) a survey of recent results on the problem of the existence of infinitely many periodic orbits for Hamiltonian diffeomorphisms and Reeb flows. We focus on the Conley conjecture, proved for a broad class of closed symplectic manifolds, asserting that under some natural conditions on the manifold every Hamiltonian diffeomorphism has infinitely many (simple) periodic orbits. We discuss in detail the established cases of the conjecture and related results including an analog of the conjecture for Reeb flows, the cases where the conjecture is known to fail, the question of the generic existence of infinitely many periodic orbits, and local geometrical conditions that force the existence of infinitely many periodic orbits. We also show how a recently established variant of the Conley conjecture for Reeb flows can be applied to prove the existence of infinitely many periodic orbits of a low-energy charge in a non-vanishing magnetic field on a surface other than a sphere.