Applications of class number There is the notion of class number from algebraic number theory. Why is such a notion defined and what good comes out of it?
It is nice if it is $1$; we have unique factorization of all ideals; but otherwise?
 A: We say that a prime p is regular if it does not divide the class number of the p-th cyclotomic field. For regular primes, it is easy to prove Fermat's last theorem, as outlined for instance in Milne's notes.
Basically, everything would be easy if the class number was 1, in which case one could use unique factorization. If the class number is prime to p, you use the fact that every ideal whose p-th power is principal must itself be principal. This, together with unique factorization for ideals, turns out to be all that you need in the naif proof.
A: Well, class field theory states that the class number is the degree of the largest everywhere-unramified abelian extension of a number field (namely, the Hilbert class field).  But class field theory really says a lot more: it says that there's an isomorphism between the Galois group and the ideal class group. And in general, for any abelian extension $L/K$, there's an isomorphism between $G(L/K)$ and a certain "generalized ideal class group" of $K$ where you quotient by ideals that are norms from $L$.  This can be stated somewhat more elegantly using ideles.
But, you asked about the class number. In class field theory, it's difficult (to my knowledge) to prove directly that the Artin reciprocity map defined from ideals to the Galois group is an isomorphism. You can show that it is surjective and injective, however; to do this, you have to estimate the order of these generalized ideal class groups, which you can do using either analytic (L-function) methods or algebraic (e.g., using the Herbrand quotient) methods. So this is where the size and seemingly "decategorified" properties (like the order) become more important than the groups themselves: the proofs.
A: Frequently in studying diophantine equations, or related problems, one is forced to look at rings of integers of algebraic number fields, and it may be that the class number of the ring your are forced to deal with is > 1.  In this case, there is nothing you can do to change that fact; you have to live with it.  
As a response, it is natural to try and develop a theory of the class number and the class group, as a means of finding ways to deal with the failure of unique factorization.  Kummer was the one who invented the notion of class number, and he did in the course of his work on Fermat's Last Theorem; this is what is described in Andrea Ferretti's answer, and is an excellent example of what I am talking about.  
Another example, quite different in nature, occurs in the proof of Dirichlet's theorem on primes in arithmetic progressions.    This is the theorem that if a and d are coprime natural numbers, then there are infinitely many primes p such that p is congruent to a mod d.  
In his proof, he reduces everything to showing that a certain number (the value at 1 of a certain so-called L-function) is non-zero.  He then is able to give a precise formula for this L-function, and shows that it is equal to some non-zero constants times a certain class number.  Since the class number is positive (and so in particular, is non-zero!), he is able to complete his proof.
A: As others have said, often what you want for a particular Diophantine application is that the class number of a certain number field be relatively prime to a certain number.  The famous example of this (as already noted by others) is Kummer's Theorem that for an odd prime $p$, the Fermat equation $x^p + y^p = z^p$ has no integer solutions with $xyz \neq 0$ if the ring of integers of $\mathbb{Q}[e^{\frac{2 \pi i}{p}}]$ has class number prime to $p$.
Another -- simpler -- nice example is the Mordell equation $y^2 + k = x^3$.  If $k \equiv 1,2 \pmod 4$ and the ring $\mathbb{Z}[\sqrt{-k}]$ has class number prime to $3$, then all of the integer solutions to the Mordell equation can be found.  See Section 4 of
http://alpha.math.uga.edu/~pete/4400MordellEquation.pdf
for an exposition of this which is (I hope) reasonably elementary and accessible to undergraduates.
A: The class group of a number field $K$ can be used to parametrize other objects. 
1) If $[L:K] = n$, the possible $O_K$-module structure of $O_L$ is described by the ideal classes of $K$, although it is still an open question in general to show for each $n > 1$ and each ideal class of $K$ that there's an extension $L/K$ with degree $n$ such that $O_L$ as an $O_K$-module corr. to that ideal class.  (This is known for small $n$, but not for general $n$.) 
2) The orbits of the action of $\text{SL}_2(O_K)$ on ${\mathbf P}^1(K)$ are in bijection with ideals classes in $K$.  For instance, the action is transitive iff $K$ has class number 1. 
3) When $O$ is a quadratic order with discriminant $d$, the (narrow) class group of $O$ describes the primitive quadratic forms of discriminant $d$ up to proper equivalence.  Here we need a slightly more general concept than the usual ideal class group (unless $O = O_K$).
4) Weierstrass equations for an elliptic curve over $K$ up to a standard change of variables are related to ideal classes in $K$ (see Silverman's first book on ell. curves, Chap. VIII).
