I guess this should be true if and only if $f : X \to X$ fixes a polarization, i.e. there is an ample $A$ such that $f^\ast A \sim A$.
If there is such an $A$, then take the embedding of $X$ into $\mathbb P^n$ by a very ample $mA$. The automorphism of $X$ is then induced by the linear map $f^\ast : \mathbb PH^0(X,mA) \to \mathbb PH^0(X,mA)$. Conversely, if a map comes from a linear map on projective space, then the polarization given by restricting the hyperplane is fixed.
Typically automorphisms won't fix any polarization, so don't come from $\mathbb P^n$. If you actually want to check it for a specific map, the first thing to do work out the induced map on $H^2(X;\mathbb R)$. If there is an invariant ample divisor, its first chern class will be invariant under the pullback. So you may be able to show that this doesn't happen. If there is a fixed class, you need to know (a) whether it is represented by an ample divisor, which may or may not be easy to check depending on what $X$ is and (b) whether the divisor is linearly equivalent (rather than just numerically equivalent) to its pullback, which requires a bit more scrutiny.
As Francesco points out, $K_X$ always pulls back to itself under an automorphism, so if it's either ample or antiample you have what you want.