How to characterize all finite commutative local rings with the maximal ideal of fixed order (if the order is small)? 
Let $R$ be a finite commutative local ring with the maximal ideal $M$ of order $m$. How to characterize all such finite commutative local rings? 

For examples, if $m=2$, then $R\cong\mathbb{Z}_4$ or $\mathbb{Z}_2[X]/(X^2)$; if $m=3$, then $R\cong  \mathbb{Z}_9$ or $\mathbb{Z}_3[X]/(X^3)$. 

How about $m=5$ and $m=7$? Is there a method to list all such finite commutative local rings?

 A: Suppose $m = p$ is prime. Then since a local ring has prime power characteristic which is a multiple of that of its residue field, $|R/M| = p$, so $|R| = p^2$. Thus the additive group $(R, +)$ is either $\mathbb{Z}/p^2\mathbb{Z}$ or $\mathbb{Z}/p\mathbb{Z} \oplus \mathbb{Z}/p\mathbb{Z}$. In the first case $R \cong \mathbb{Z}/p^2\mathbb{Z}$ as rings, as the canonical map $\mathbb{Z} \to R$ has kernel $p^2\mathbb{Z}$, so $\mathbb{Z}/p^2\mathbb{Z} \hookrightarrow R$ is an isomorphism by cardinality reasons.
In the second case, $R$ is $2$-generated as an additive group. Taking one generator as the unit in $R$, we have that $R$ is a $\mathbb{Z}/p\mathbb{Z}$-algebra generated by a single element, which gives a ring surjection $\varphi : (\mathbb{Z}/p\mathbb{Z})[x] \twoheadrightarrow R$, sending $x$ to a nonunit. Since $M^2 = 0$ in $R$ (as $M$ is simple, $M^2 \subseteq M$, and equality holds only if $M = 0$ by Nakayama), $\varphi(x)^2 = 0$, so $(\mathbb{Z}/p\mathbb{Z})[x]/(x^2) \twoheadrightarrow R$, which is again an isomorphism for cardinality reasons.
Thus the only finite commutative local rings whose maximal ideal has prime order $p$ are $\mathbb{Z}/p^2\mathbb{Z}$ and $(\mathbb{Z}/p\mathbb{Z})[x]/(x^2)$.
