The eigenfunctions of the angular momentum operators are the spherical harmonics $Y=Y(\theta , \varphi)$. The eigenvalue equation is given by: $$\hat{l}_z Y(\theta , \varphi)=bY(\theta , \varphi)$$ Where b is the eigenvalue of $\ hat{l}_z$. Substituting $\hat{l}_z = -i\hbar\frac{\partial}{\partial\varphi}$ into the eigenvalue equation $$-i\hbar\frac{\partial}{\partial \varphi}Y(\theta , \varphi)=bY(\theta , \varphi)$$ Splitting the spherical harmonic into a product of two functions dependent on a single variable $Y(\theta , \varphi)=S (\theta)T(\varphi)$ $$-i\hbar\frac{\partial}{\partial\varphi}\left[S(\theta)T(\varphi)\right]=bS( \theta)T(\varphi)$$

$$-i\hbar \cancel{S(\theta)}\frac{\partial T(\varphi)}{\partial\varphi}=b \cancel{S(\theta)}T(\varphi)$$ Separating variables and integrating $$\frac{dT(\varphi)}{T(\varphi)}=\frac{ib} {\hbar}d \varphi\;\;\rightarrow \;\;T(\varphi)=Ae^{ib\varphi/\hbar}$$ The function $T(\varphi)$ is not admissible as its own since by adding $2\pi$ to $\varphi$, we are at the same point in space and the function $T(\varphi)$ should not change. To solve this problem we apply boundary conditions forcing $T(\varphi)$ to be periodic with period $2\pi$. $$T(\varphi + 2\pi)=T(\varphi)$$ $$Ae^{ib(\varphi+2\pi)/\hbar}=Ae^{ ib\varphi/\hbar}$$ $$\cancel{Ae^{ib\varphi/\hbar}}e^{ib2\pi/\hbar}=\cancel{Ae^{ib\ varphi/\hbar}}$$ Simplifying: $e^{ib2\pi/\hbar}=1$ Using Euler's relation $e^{i\alpha}=cos\alpha + isen\alpha$ \ begin{equation} e^{ib2\pi/\hbar}=1=cos\frac{b2\pi}{\hbar}+isen\frac{b2\pi}{\hbar} So that this If the last equation is true, the cosine must be 1 and the sine 0. $$\frac{b2\pi}{\hbar}=2\pi m \;\;\rightarrow b=m\hbar \;\ ;with\;m=0,\pm 1, \pm 2,....$$ $$T(\varphi)=Ae^{im\varphi}\;\; m=0,\pm 1, ±2,....$$ Factor A is calculated by normalization $$1=\int_{0}^{2\pi}T^{\ ast}(\varphi)(\varphi)d\varphi =\int_{0}^{2\pi}A^{\ast}e^{-im\varphi}Ae^{im\varphi}d\varphi= |A|^2 \int_{0}^{2\pi}d\varphi=|A|^2 2\pi$$ $$A=\frac{1}{\sqrt{2 \pi}}$$ $$T(\varphi)=\frac{1}{\sqrt{2\pi}}e^{im\varphi}\;\;m=0,\ pm 1, ±2......$$