Let me give an answer that pertains to the Diophantine equation that, according to David Speyer's answer, Lenstra was specifically talking about.
How does representing functors help solve the Diophantine equation $a^n + b^n=c^n$?
A solution to this Diophantine equation defines an elliptic curve $y^2 = x (x-a^n)(x-b^n)$ (Frey). The Galois group of the rational numbers acts on the $\overline{\mathbb Q}$-points of this curve, thus on the $\ell^m$-torsion points for each $m$. Taking an inverse limit as $m$ goes to $\infty$, we obtain a Galois action on a rank two free $\mathbb Z_\ell$-module (the Tate module).
We also obtain Galois actions on rank two free $\mathbb Z_\ell$-modules from modular forms, after Eichler-Shimura and Deligne. In fact, for many different rings $S$ we can obtain Galois actions on rank two free $S$-modules.
It turns out that the Galois representations arising from curves of the form $y^2 = x (x-a^n)(x-b^n)$ have very special properties on congruence mod $n$, properties which the Galois representations arising from modular forms cannot have (Ribet). So if we can show that every Galois representation arising from an elliptic curve also arises from a modular form, we can obtain a contradiction from any solution to the Diophantine equation.
Now here's where we introduce the functors to be represented. We consider the category of complete local rings $S$ of residue characteristic $\ell$, and the functor that sends each such ring to the set of isomorphism classes of rank two free $S$-modules with a Galois action that is congruent mod $\ell$ to some fixed Galois representation, satisfying some conditions known to hold for elliptic curves. We can consider another functor that sends the ring $S$ to only the set of isomorphism classes that arise from modular forms.
We'd like to prove the natural transformation from one of these functors to the other is an isomorphism, which is equivalent to the statement about every Galois representation arising from a modular form. In general, this is a hard problem.
But if we can represent these functors by complete local rings of residue characteristic $\ell$, then it becomes equivalent to proving that a map of local rings $R \to T$ is an isomorphism. That's a question which is much easier to tackle, because we can use all the commutative algebra theory of local rings. In particular, we can hope to prove a criterion for the map to be an isomorphism that depends on concrete properties of these rings which can be expressed in terms of the original functors. (The simplest case of this is that a map of smooth local rings is an isomorphism if and only if it's an isomorphism on the residue field and tangent space, which both have a functorial interpretation in terms of very simple rings.) We then reduce the problem to checking some new properties are satisfied by the functors. These properties turn out to be much more tractable than proving the isomorphism directly. In part, this is because they connect to areas where there is a pre-existing theory (related to $L$-functions, the class number formula, Iwasawa theory) that can be applied (though of course deep new ideas were needed as well).