There is something wrong in the first sentence of the accepted answer. The problem is that the minimal polynomial for a matrix may not be irreducible. For example, the matrix $$\begin{bmatrix}1& 1 \\ 0 &1 \end{bmatrix}\in M_n(\mathbb{Q})$$ has minimal polynomial $(x-1)^2$ which is reducible.
However, the conclusion for the $GL_4(\mathbb{Q})$ is still right. This is mainly because $4$ is too small.
Suppose $A$ has order $n$, then $A$ satisfies $x^n-1$ and $A^k - I\neq 0$ for all $k< n$. Let $m(x)$ be the minimal polynomial of $A$, then we have
- $m(x)|x^n-1 = \prod_{d|n}\Phi_d(x)$
- $m(x)\nmid x^k - 1$ for all $k< n$
Since $\Phi_d(x)$ are irreducible (prime) over $\mathbb{Q}$, hence $m(x) = \prod_{d_i} \Phi_{d_i}(x)$ for some distinct $d_i|n$. Let $k = lcm(d_1, d_2, \ldots)$. If $k<n$, then we have $m(x)|\Phi_k(x)$ which is a contradiction. Hence we must have $lcm(d_1,d_2,\ldots) = n$. Note that $\deg m(x) \leq 4$, hence we have $\sum \phi(d_i) \leq 4$. Then after a tedious checking (check for all possible $d_i$'s), we still get $\phi(n)\leq 4$ as that answer claims.
The general conclusion in that answer is wrong. Here is an concrete counter-example:
We work in $GL_8(\mathbb{Q})$, and we show that there is element of order $21$ yet $\phi(21) = 12 > 8$. Pick $f_A(x) = m(x) = \Phi_3(x)\Phi_7(x)$ ($f_A$ is the characteristic polynomial for $A$), then $\deg m(x) = \phi(3)+\phi(7) = 8$. Also, note that $m(x)\nmid x^k - 1$ for $k<21$. (Suppose it divides, then $3|k, 7|k$ implies that $lcm(3,7) = 21 | k$ which is a contradiction). Hence we find a matrix of order 21 (A is invertible since the constant term for its characteristic polynomial $f_A$ is 1).