Theorems with finite sets of exceptions Exceptions are interesting. Sometimes, they're also important. If a theorem with exceptions is important for a subject, there are liable to be many corollaries of the form "either this is true... or these exceptional circumstances hold". When the exceptions are finite in number, it's particularly nice because then it's feasible to build a complete picture of the exceptions.
Many exceptions turn out to be related to one another, or to other important ideas.
There are plenty of examples on Wikipedia, which has an impressive diagram relating some of them.
Here are a few more, in no particular order:

*

*The hyperbolic plane can be tiled with $n$-gons, three meeting at a vertex, iff $n > 2\pi$.


*Every prime is of the form $4n \pm 1$, except $2$.


*The quadratic field $\mathbb{Q}[\sqrt{-n}]$ has unique factorization in its ring of integers iff $n \in \{1,2,3,7,11,19,43,67,163\}$, the Heegner numbers.


*The finite ring $\mathbb{Z}/n\mathbb{Z}$ admits a compatible exponential operation iff $n \in \{1,2,6,42,1806\}$, with the sequence ending there because $1807$ is composite.


*Surgery theory works in dimensions $>4$ (for smooth manifolds) or $>3$ (for topological manifolds).
I'd also welcome examples where the set of exceptions is not literally finite but is relatively compact, given a sensible (non-compact) topology on the overall space. For example:

*

*If $0 \le x < y$ then either $x^y > y^x$ or $x < \mathrm{e}$.

 A: The Lewin-Witek conjecture, concerning the index of primitivity of an $n\times n$ matrix, was proved to be false for $n=11$ but to hold for all other $n$. The definitions (which are quite elementary) and history can be found in the answer I posted to https://math.stackexchange.com/questions/450090/if-p-is-a-regular-transition-probability-matrix-then-pn2-has-no-zero-ele
A: There are a number of theorems in elementary geometry which are true, but with (basically) one exception. Since these are some of the most basic and most cited/discussed such results and the fact that they are not universally true is rarely mentioned, it is perhaps worth posting them on this site.  The most ubiquitous examples are: the pons asinorum (if two sides of a triangle are equal  then so are the opposite sides), the converse of Pythagoras and the SAS theorem (if two corresponding sides and included angles of a pair of triangles are equal, then so are the remaining side and angles).  Before pointing out the exceptional cases, let me start by responding to  a possible accusation of nitpicking.  Firstly, it is part of the mathematician's hippocratic oath that when he states a theorem, it should be true (without exception). Perhaps more importantly, a typical proof in synthetic geometry involves starting from a basic configuration, then successively constructing points, lines, triangles, circles ...  , followed by making suitable deductions about the new elements.  Now if, for example, one proceeds by showing that a triangle constructed in this manner has two equal sides and deducing the equality of two angles, using pons asinorum,  it is then imperative to show that the exceptional case cannot occur, or, alternatively, to expand the proof to include it.
It will suffice to illustrate my point about gaps in the statements of celebrated results to consider the converse to Pythagoras: if in a triangle $ABC$, $|AC|^2=|AB|^2+|BC|^2$, then $<ABC$ is a right angle.     The exceptional case is that where $A=B$, since then the above angle is not (and cannot be sensibly) defined.
Such anomalies can lead to some rather delicate problems.  Such a case is the Steiner-Lehmus theorem (if two angle bisectors of a triangle are equal, then it is isosceles) which has generated much controversy, even amongst some very distinguished mathematicians, not so much for the result itself, but for the nature of the proofs, in particular, the question of whether it is possible to give a simple, direct one.  Again, the case where two of the vertices of the triangle coincide is exceptional and some arguments against the existence of a direct proof use  a continuity argument--varying the shape of the triangle in a way which necessarily involves  passing through the dodgy situation.
