Angular momentum in quantum mechanics
In three dimensions with a central potential V(r), separate the wavefunction into a radial part and an angular part. The angular part is universal — it belongs to the angular momentum operators, and its eigenfunctions are the spherical harmonics Y_\ell^m(\theta,\phi), the same for every central force. Two quantum numbers label them: \ell=0,1,2,\dots sets the magnitude, and m=-\ell,\dots,+\ell sets one component.
The eigenvalues of total angular momentum squared and its z-component.
The angular momentum algebra: the components do not commute, but each commutes with L².
Spin: the intrinsic twist
Beyond the angular momentum of its orbit, an electron carries an irreducible internal angular momentum: spin. It obeys the same algebra as orbital angular momentum but with half-integer quantum number s=\tfrac12, so it has just two states, spin-up and spin-down. Spin is why the Stern-Gerlach experiment splits a beam in two, and it doubles the count of every electronic state.
Spin-½ has magnitude \hbar\sqrt{3}/2 and only two projections, \pm\hbar/2.
Adding angular momenta
An electron has both orbital and spin angular momentum, and they combine into a total \mathbf J = \mathbf L + \mathbf S. Quantum mechanically you cannot just add the vectors; the addition of angular momenta follows a strict rule for the allowed total quantum number j, running in integer steps from |\ell-s| to \ell+s. The change of basis between separate and combined descriptions is done by the Clebsch-Gordan coefficients.
The triangle rule for combining two angular momenta into a total j.
This is not bookkeeping for its own sake. The magnetic interaction between an electron's spin and the field of its own orbit — spin-orbit coupling — splits atomic levels into the fine structure you see as closely spaced spectral doublets. The combined state is labelled by a term symbol ^{2S+1}L_J, the compact code an atomic physicist reads at a glance.
The hydrogen atom and its quantum numbers
Now the crown jewel. Put a single electron in the Coulomb potential of a proton, V(r)=-e^2/4\pi\varepsilon_0 r, and solve. The radial equation, together with the spherical harmonics, yields the hydrogen atom exactly. Remarkably, the bound-state energies depend only on the principal quantum number n — not on \ell or m.
The hydrogen energy levels; the constant 13.6 eV is the Rydberg energy.
Each state is fixed by four quantum numbers: n (energy, 1,2,3,\dots), \ell (orbital shape, $0 to n-1$), m (orientation, -\ell to +\ell), and m_s=\pm\tfrac12 (spin). Counting them, level n holds 2n^2 distinct states — the degeneracy that, once you forbid electrons from sharing a state, generates the shell structure of every atom.
Filling atoms: the Pauli principle
One rule turns the hydrogen states into chemistry: the Pauli exclusion principle. No two electrons in an atom may share all four quantum numbers. Electrons therefore stack into successive states rather than all collapsing into the ground level, building the shells and subshells whose filling — refined by Hund's rules — is the periodic table itself.