$A$ is an invertible real matrix, is there a real matrix $B$ such that $A=B^3$?
For the complex case, it is not difficult. Over complex numbers, every invertible matrix has a cubic root. In fact, over $\mathbb C$, since every invertible matrix has a logrithm, we can take a family of matrices $e^{t\log A}$, and taking $t=1/3$ yields a square root of $A$.
The condition "invertible " is necessary for the real case. In fact, here's a counterexample link.
How about general cases? $A$ is an invertible real matrix, is there a real matrix $B$ such that $A=B^n$, where integer $n\geq 2$?
Yes. It suffices to prove that $A$ is similar to a real matrix $C$ that can easily be seen to have a real cubic root $R$. So, if $P^{-1}CP=A$ and $R^3=C$, we may take $B=P^{-1}RP$.
Since all real matrices admit “real Jordan forms” (please consult Matrix Analysis by Horn and Johnson if you don't know what a real Jordan form is), it suffices to consider the case where $A$ is a real Jordan form with a single Jordan block. That is, we may assume that $$ A=J_k(\lambda)=\pmatrix{\lambda&1\\ &\ddots&\ddots\\ &&\ddots&1\\ &&&\lambda} \quad\text{or}\quad A=J_k(rQ_\theta)=\pmatrix{rQ_\theta&I_2\\ &\ddots&\ddots\\ &&\ddots&I_2\\ &&&rQ_\theta} $$ where $\lambda$ is a nonzero real number, $r>0$ and $Q_\theta\ne\pm I_2$ is the $2\times2$ rotation matrix for angle $\theta$.
If $A=J_k(\lambda)$, take $R=J_k(\lambda^{1/3})$. Then $C$ and $A$ are similar because both of them are non-derogatory matrices with the same minimal polynomial $(x-\lambda)^k$. (That $\lambda\ne0$ is essential here. If $\lambda=0$, the minimal polynomial of $C=R^3$ is no longer $(x-\lambda)^k$ unless $k=1$).
Similarly, if $A=J_k(rQ_\theta)$, take $R=J_k(r^{1/3}Q_{\theta/3})$. Note that $A$ and $R$ are similar over $\mathbb C$ to $$ J_k(re^{i\theta})\oplus J_k(re^{-i\theta}) \quad\text{and}\quad J_k(r^{1/3}e^{i\theta/3})\oplus J_k(r^{1/3}e^{-i\theta/3}) $$ respectively. Thus the minimal polynomials of $A$ and $C$ (as $r\ne0$) are both equal to $(x-re^{i\theta})^k(x-re^{-i\theta})^k=\left(x^2-2r\cos(\theta)x+r^2\right)^k$. So, the two matrices are again similar because they are non-derogatory matrices with the same minimal polynomial.