The maximum number of electrons that can occupy a single atomic orbital is two. They must have opposite spin states.
An orbital is a quantum state described by three quantum numbers: principal, angular-momentum, and magnetic. The electron's spin supplies a fourth quantum number, which can have two allowed projections, commonly represented as spin-up and spin-down. The Pauli exclusion principle says that no two identical fermions in an atom can share all four quantum numbers.
This is why two electrons can share one orbital, but only if their spins differ. For example, helium has two electrons in its 1s orbital, paired with opposite spins. A third electron cannot enter that same orbital and must occupy a higher-energy orbital.
A common mix-up is confusing an orbital with a shell or subshell. One orbital holds two electrons; a subshell can contain several orbitals, and a principal shell can contain even more. The familiar shell capacities of 2, 8, 18, and so on refer to larger groupings, not to one orbital.