A famous theorem by Hopf proves that any constant mean curvature sphere in $\mathbb R^3$ is a round sphere. In this talk we will generalize Hopf's theorem to classes of surfaces modeled by arbitrary elliptic PDEs in arbitrary three-manifolds, with the only hypothesis of the existence of a family of "candidate surfaces" within the class. In this way, we prove that any immersed sphere in such a class of surfaces is a candidate sphere. As an application, we prove a 1956 conjecture by A.D. Alexandrov on the uniqueness of immersed spheres of prescribed curvatures in $\mathbb R^3$, and we complete the characterization of round spheres as the only elliptic Weingarten spheres in $\mathbb R^3$ (Weingarten spheres are immersed spheres in $\mathbb R^3$ whose principal curvatures are linked by a non-trivial elliptic relation). This is a joint work with J.A. Gálvez.