The spectral asymptotics of elliptic operators (e.g. the Laplacian) and analytic number theory are linked together via lattice point counting problems. As an example, counting eigenvalues of the Laplacian on a flat square torus corresponds to counting integer points in a disk of large radius, which is precisely the Gauss circle problem, a longstanding problem in analytic number theory. In this presentation, I will explain how lattice counting methods are applied to study spectral asymptotics for Schrödinger operators on waveguides and resonators, and also for the Steklov eigenvalue problem on a cube. These two settings will illustrate different flavors of lattice counting problems arising in spectral theory. The talk is based on joint works with L. Parnovski (UCL), as well as with A. Girouard (Laval), I. Polterovich (Montréal) and A. Savo (Rome).