HINT: There's two things you need to show.
$(i)$ $\vert Aut(G)\times Aut(H)\vert\le \vert Aut(G\times H)\vert$, and
$(ii)$ $\vert Aut(G)\times Aut(H)\vert\ge \vert Aut(G\times H)\vert$.
Let's start with $(i)$. Suppose I have an automorphism $\alpha$ of $G$, and an automorphism $\beta$ of $H$. Do you see how to build a "product automorphism" $\alpha\times \beta$ of $G\times H$? Do you see how to show that this is injective - that is, $\alpha_0\times\beta_0=\alpha_1\times\beta_1\implies \alpha_0=\alpha_1, \beta_0=\beta_1$?
As for $(ii)$, this is harder. We basically want to show that every automorphism of $G\times H$ is of the form $\alpha\times \beta$ for some $\alpha\in Aut(G)$ and $\beta\in Aut(H)$. This is where the condition on the gcd of the orders of $G$ and $H$ comes in. HINT: suppose the orders of $G$ and $H$ are relatively prime. Can $G$ and $H$ have nonidentity elements $a$ and $b$ with the same order?