Aren’t the spherical harmonics functions with domain S^2, the sphere? I think the solutions to the (time-independent) Schrödinger equation for an electron in a hydrogen atom are given by like, a product of a function of distance from the center with one of the spherical harmonics, or something like that?
you are correct. The Schrödinger equation for the hydrogen atoms in spherical coordinates demonstrates separability which allows you to separate the radial and angular coordinates. The radial term, which is most interesting due to the 1/r potential is typically a Laguerre polynomial. The angular term is 'free' from any potential is typically a spherical harmonic.
The spherical harmonics in general are typically derived as part of the solution to the Laplace equation in spherical coordinates. A bit of a semantic point (though perhaps the distinction is important) though, since the Laplace equation's angular dependence is identical to that of the Schrödinger equation for the hydrogen atom.
It's actually more confusing IMHO, because these graphs overload the radial dimension to show probability as "distance from the origin". You have to multiply that by the radial function to get an actual probability distribution, which kinda/sorta looks like these pictures but not really.
Really the harmonics are best understood as something like "wave height on the surface of a sphere". They tell you how the electrons (or whatever) are going to distribute themselves radially, not where they're going in 3D space.
Also FWIW: the much harder thing to grok here (at least it was for me), and that no one tries to tackle, is why the "l" number corresponds directly to angular momentum. In particular "l==0" doesn't look like there's any rotation going on at all.
Simply speaking, "l" describes the number of nodes. In the same sense that a particle in a box with sin(nx) wave function has more nodes the higher energy (or momentum) state it is in.
As for why l==0 has no rotation going on at all, one would say that this should be expected. Qualitatively, the symmetric sphere does not change with rotation, so how would we tell if it is rotating or not? And perhaps the next step is controversial, but if there is no way to tell, maybe there is no dependence? This is a similar argument to why the electric field of an infinite plane is constant with respect to distance from it.