Let $A$ be any $n\times n$ matrix over an arbitrary field $K$, and denote by $f(x)$ and $m(x)$ its characteristic and minimal polynomials, respectively. It is clear these two polynomials coincide iff $\deg m(x)=n$. The following theorem involves some interesting properties of the centralizer $C(A)=\{X\in K^{n\times n}\mid AX=XA\}$.
Theorem. The following statements are equivalent for $A$:
(1) $\deg m(x)=n$;
(2) $A$ being placed in an algebraic closure $L$ of $K$, its Jordan normal form comprises Jordan blocks of distinct eigenvalues;
(3) $C(A)=\{p(A)\mid p$ is a polynomial over $K$};
(4) $\dim C(A)=n$.
(Statement 2 is inspired by an article in the comment section of Hamou's answer, which proved that $\dim C(A)\geqslant n$ always holds and $\dim C(A)$ is irrelevant to the base field.)
Proof. (2)$\Rightarrow$(1) is easy and (1)$\Rightarrow$(2) is proved by contradiction (omitted). To show equivalence among (2)(3)(4), we must derive a formula of $\dim C(A)$ with regard to the Jordan normal form of $A$. Suppose that $A$ has $s$ distinct eigenvalues $\lambda_1,\cdots,\lambda_s$ and
$$A=\mathop{\mathrm{diag}}(J_{\lambda_1}(n_{11}),\cdots,J_{\lambda_1}(n_{1r_1}),\cdots,J_{\lambda_s}(n_{sr_s})),$$
where $J_\lambda(n)$ is the $n\times n$ Jordan block $\lambda$:
$$J_\lambda(n)=\begin{bmatrix}\lambda&1\\&\lambda&1\\&&\ddots&\ddots\\&&&\lambda&1\\&&&&\lambda\end{bmatrix}.$$
Let $J_i=\mathop{\mathrm{diag}}(J_{\lambda_i}(n_{i1}),\cdots,J_{\lambda_i}(n_{ir_i}))$ and denote its size by $d_i=n_{i1}+\cdots+n_{ir_i}$.
Viewing $A$ as a linear transformation on $L^n$, one decomposes $L^n$ into a direct sum of root subspaces of $A$, each being invariant under $A$. If $B\in C(A)$, it leaves those root subspaces invariant, too. So $B$ is a block diagonal matrix having $s$ blocks:
$$B=\mathop{\mathrm{diag}}(B_1,\cdots,B_s),$$
where $B_i$ is of size $d_i$, i.e., dimension of the root subspace of eigenvalue $\lambda_i$. Partion $B_i$ into the same shape of $J_i$:
$$B_i=\begin{bmatrix}B_{i,11}&\cdots&B_{i,1r_i}\\\vdots&\ddots&\vdots\\B_{i,r_i1}&\cdots&B_{i,r_ir_i}\end{bmatrix},$$
where $B_{i,jk}$ is of size $n_{ij}\times n_{ik}$. The equation $B_iJ_i=J_iB_i$ is equivalent to $r_i^2$ smaller and independent equations
$$J_{\lambda_i}(n_j)B_{i,jk}=B_{i,jk}J_{\lambda_i}(n_k),\quad 1\leqslant j,k\leqslant r_i.$$
The solution space of the above equation is of dimension $n_k$, and hence $\dim C(J_i)=d_ir_i$. Consequently
$$\dim C(A)=\sum_{i=1}^sd_ir_i,$$
where $s$ is number of distinct eigenvalues of $A$, $d_i$ is dimension of root subspace belonging to eigenvalue $\lambda_i$, and $r_i$ is number of Jordan blocks belonging to $\lambda_i$.
Now one easily sees that $\dim C(A)=n$ iff each $r_i$ equals 1 (this is Statement 2). Thus we proved (4)$\Rightarrow$(2), and hence equivalence among (1)$\sim$(4).