The eigenvalues of [itex]\hat{L}^2[/itex] are always [itex]\hbar^2l(l+1)[/itex]. The angular momentum operator is completely independent of the potential. Moreover, its eigenfunctions are always spherical harmonics.
However the angular momentum ##l## will only be a good quantum number if [itex]\hat{L}^2[/itex] commutes with the potential ##\hat{V}(\mathbf{x})##, so ##[\hat{L}^2,\hat{V}(\mathbf{x})]=0##. This implies that the potential is spherically symmetric.
If the potential is not spherically symmetric, the energy eigenfunctions will not be proportional to individual spherical harmonics. It is still possible to write solutions in terms of a linear combination of spherical harmonics, but a given energy eigenstate will not correspond to single values of ##l,m##.