Both are divisible by $x$ so $$x^{p^m}-x\mid x^{p^n}-x\qquad\iff\qquad x^{p^m-1}-1\mid x^{p^n-1}-1.$$ By this question we have $x^a-1\mid x^b-1$ if and only if $a\mid b$, so applying this twice shows that $$x^{p^m-1}-1\mid x^{p^n-1}-1 \qquad\iff\qquad p^m-1\mid p^n-1 \qquad\iff\qquad m\mid n.$$