Let us consider requirements for commutativity of matrices in terms of the Jordan Normal Form, Say we have two matrices $\bf A$ and $\bf B$. Then ${\bf A} = {\bf S}^{-1}{\bf JS}$, where $\bf J$ can be written in block matrix form:
$${\bf J} = \left[ \begin{array}{ccccc} {\bf \Lambda_1} & \bf 0 & \cdots & \bf 0 & \bf 0 \\ \bf 0 & \bf \Lambda_2 & \cdots &\bf 0 & \bf 0\\ \bf 0&\bf 0 &\bf \ddots & \bf 0 & \bf 0 \\ \bf 0&\bf 0&\cdots&\bf \Lambda_{n-1}& \bf0\\ \bf 0 &\bf 0&\cdots& \bf 0 & \bf\Lambda_n \end{array}\right] $$
where $$ {\bf \Lambda_k} = \left[ \begin{array}{ccccc} {\bf \Lambda_{k,1}} & \bf 0 & \cdots & \bf 0 & \bf 0 \\ \bf 0 & \bf \Lambda_{k,2} & \cdots &\bf 0 & \bf 0\\ \bf 0&\bf 0 &\bf \ddots & \bf 0 & \bf 0 \\ \bf 0&\bf 0&\cdots&\bf \Lambda_{k,m-1}& \bf0\\ \bf 0 &\bf 0&\cdots& \bf 0 & \bf\Lambda_{k,m} \end{array}\right] $$
where each $$ {\bf \Lambda_{k,l}} = \left[ \begin{array}{cccc} {\lambda_{k}} & 1 & 0 & 0 \\ 0 & \lambda_{k} & \ddots & 0 \\ 0& 0& \ddots & 1 \\ 0& 0&0& \lambda_k \end{array}\right]$$ where the matrix size may be individual for each $l$.
Let us now assume that we can write $\bf B = S^{-1}J_BS$. For which $\bf J_B$ will this commute? Any necessary or sufficient conditions?
Clarification: I did not intend $\bf J_B$ to be a Jordan matrix like $\bf J$ above. Are there any other types of matrices for which it could work? What could we say about such a matrix? Does it need to have any specific type of block structure?
Remark. $A,B$ commute does not imply that $A,B$ are simultaneously Jordanizable, cf. Simultaneous Jordanization? . For instance, $J_3$ the nilpotent Jordan block of dimension $3$ and $J_3^2$ are not simult. Jordan.; moreover $J_3,2J_3$ are not simult. Jordan.
Here, the matrices that commute with $J$ are of the form $diag(B_1,\cdots,B_n)$ where $\Lambda_iB_i=B_i\Lambda_i$. Then we may assume that $A=diag(J_{i_1},\cdots,J_{i_k})$, where $J_k$ is the nilpotent Jordan block of dimension $k$ and $B$ is in one of its Jordan forms. I think that we can generalize the following example:
Let $A=diag(J_2,J_2)$. Then $B=diag(U,V)$ where $U=aI_2+J_2$ or $U=aI_2$ and $V=bI_2+J_2$ or $V=bI_2$ ($4$ forms for $B$).