As Michael indicates in his first sentence, the answer is basically straightforward (though not usually written down in the very explicit way you request). It may be helpful to add some perspective, since this type of question comes up in different levels of generality. The recent research literature provides some fine-tuning, especially in prime characteristic, but is not at all essential for the concrete case you are looking at.

Classically, study of the centralizer of a typical $n \times n$ matrix starts with Jordan canonical form and arrives quickly at an overall dimension formula. This usually requires an algebraically closed field, but in the case of a nilpotent (or unipotent) matrix that isn't essential. In the language of partitions, you have to pass to the transpose partition as Michael shows. It makes no real difference whether you study nilpotent matrices or unipotent matrices at this point.

More generally, this kind of question arises for a reductive or semisimple Lie algebra in characteristic 0, or for a corresponding algebraic group. The simple case is the essential one, for which the Dynkin/Kostant theory provides a systematic method: here you arrive at a direct sum decomposition of the centralizer involving its nilradical and a reductive complement. Here the respective dimensions are readily computable for the general or special linear case. Moreover, the dimension of the nilpotent variety in a reductive Lie algebra (or unipotent variety in the group) is easy to compute here, since the Lie algebra is just a direct sum of certain general linear Lie algebras determined by the partition. In a reductive Lie algebra the nilpotent cone has dimension equal to the total number of roots, which together with the rank adds up to the total dimension of the Lie algebra.

For arbitrary Lie types (now working over an algebraically closed field of characteristic 0), the story is similar but less straightforward combinatorially. In good prime characteristic the answers are pretty much the same, but for bad primes the results diverge a bit for the groups and Lie algebras (except in the special linear case).

By now there are reasonable textbook references, some mentioned by Francois and by Michael, for the basic theory and dimensions involved (which make it very easy to answer the question here). Here are more explicit details:

Springer-Steinberg lectures, section IV.1, in *Lecture Notes in Mathematics* 131 (Springer, 1970).

Carter, *Finite Groups of Lie Type* (Wiley Interscience, 1985), 13.1.

Collingwood-McGovern, *Nilpotent Orbits in Semisimple Lie Algebras* (Van Nostrand Reinhold, 1993), Chapter 3.

Humphreys, *Conjugacy Classes in Semisimple Algebraic Groups* (AMS, 1995), 1.3 and 7.10 (with minor corrections on the AMS bookpage or my homepage).