For every ring R, is there a block-diagonal canonical form for a square matrix over R? This question asks whether there exists an analogue of the Jordan decomposition for an arbitrary ring $R$. This analogue is not necessarily the Jordan-Chevalley decomposition, which is unnecessarily strong. This follows from this question, but you don't need to read it.
Given a ring $R$, let $J(R)$ be the monoid whose elements are all square matrices over $R$, and where the monoid operation is $\oplus$ denoting direct sum of matrices. Let $A { \sim_\text{S}} B$ mean that there exists an invertible matrix $P$ such that $PAP^{-1} = B$. Is the monoid $J(R)/{ \sim_\text{S}}$ always a free abelian monoid?
For perfect fields, the answer is yes by the Jordan-Chevalley decomposition. What about for every ring? Is there a counterexample?
 A: Your question is equivalent to whether the category $\mathcal{E}$ of pairs $(V,f)$ consisting of a finitely generated free (right) $R$-module and an endomorphism $f$ of $V$ is a Krull-Schmidt category, i.e., an additive category where every object decomposes as a direct sum of finitely many indecomposable objects and the decomposition is unique up to isomorphism and reordering. (The category $\cal E$ is also equivalent to the category of right $R[t]$-modules which are f.g. free $R$-modules, and it is rarely Krull-Schmidt, but I won't use this point of view.)
Here is one possible counterexample, phrased using the category $\mathcal{E}$ of pairs $(V,f)$ above: Take $R$ to be a Dedekind domain admitting a non-free rank-$1$ projective module $L$ such that $L\oplus L\cong R\oplus R$ (equivalently, $L$ represents an element of order $2$ in the Picard group of $R$). Let $f_L : L^2\to L^2$ be defined by $f_L(x,y)=(0,x)$, and define $f_R:R^2\to R^2$ similarly. The isomorphism $L\oplus L\cong R\oplus R$ gives rise to an isomorphism
$$(L^2,f_L)\oplus (L^2,f_L) \cong (R^2,f_R)\oplus (R^2,f_R)$$
in $\cal E$.
One readily checks that ${\rm  End}_{\cal E}(L^2,f_L)\cong R[\epsilon|\epsilon^2=0]$ and ${\rm  End}_{\cal E}(R^2,f_R)\cong R[\epsilon|\epsilon^2=0]$, so the endomorphism rings of $(L^2,f_L)$ and $(R^2,f_R)$ contain no nontrivial idempotents. This means that these objects are indecomposable in $\cal E$. On the other hand, $(L^2,f_L)\ncong (R^2,f_R)$ because $\ker f_L\cong L\ncong R\cong \ker f_R$. Consequently, the monoid $(\cal E/\cong, \oplus)$ (which is isomorphic to $(J(R)/\sim, \oplus)$ in your question) is not a free abelian monoid (because $2x=2y$ implies $x=y$ in a free abelian monoid).
One the other hand, a sufficient (but not necessary) condition for the category $\cal E$ to be Krull-Schmidt is that the endomorphism ring of every object $(V,f)$, i.e., the centralizer of $f$ in ${\rm End}_R(V)\cong {\rm M}_n(R)$, is a semiperfect ring.
For example, if $R$ is commutative and aritinian as in Benjamin Steinberg's comment, then  ${\rm End}_{\cal E}(V,f)$ will be an $R$-subalgebra of ${\rm End}_R(V)$, hence artinian, and in particular semiperfect.
The semiperfectness ${\rm End}_{\cal E}(V,f)$ for all f.g. free $V$ is actually true even if $R$ is non-commutative one-sided artinian, and even if $R$ is just semiprimary. This appears implicitly in a paper of mine (page 20 & Thm. 8.3(iii) & Remark 2.9).
When $R$ is commutative noetherian and local, one can use a theorem of Azumaya (Theorem 22) and a little work to show that this property is equivalent to $R$ being henselian.
