In the vector model of angular momentum, the orbital angular momentum $\vec{L}$ for an electron with quantum number $l$ can take values for the angle $\theta$ with respect to the $z$ axis. For a $2p$ electron, the orbital angular momentum quantum number $l = 1$. The possible values of $m_l$ for this state are $m_l = -1, 0, 1$. The minimum angle $\theta$ corresponds to the orientation of the vector $\vec{L}$ where the orbital angular momentum is most aligned with the $z$ axis.
For the $p$-orbital ($l=1$), the minimum angle between $\vec{L}$ and the $z$ axis occurs when the orbital angular momentum vector is oriented such that the projection on the $z$ axis is minimized. This angle is 45 degrees. Thus, the minimum angle between the orbital angular momentum vector and the positive $z$ axis for a $2p$ electron is 45 degrees.