$\newcommand{\Set}[1]{\left\{ #1 \right\}}$$\newcommand{\Size}[1]{\left\lvert #1 \right\rvert}$Suppose $\Size{G} = m$ and $\Size{H} = n$.
We show that $G_{1} = G \times \Set{e_{h}} \trianglelefteq G \times H$ is the unique subgroup of order $m$ of $G \times H$. As such, it will be characteristic. A similar argument holds for $H$.
Let $T$ be another subgroup of order $m$. Then
$$
\Size{\frac{G_{1} T}{G_{1}}} = \frac{\Size{T}}{\Size{G_{1} \cap T}} \mid \Size{T} = m,
$$
but since $G_{1}T/T$ is a subgroup of $G/G_{1} \cong H$, we have also
$$
\Size{\frac{G_{1} T}{G_{1}}} \mid \Size{H} = n.
$$
Since $\gcd(m, n) = 1$, we have
$$
\Size{\frac{G_{1} T}{G_{1}}} = 1,
$$
that is, $G_{1} T = G_{1}$, or $T \le G_{1}$, so that $G_{1} = T$.
A slightly more general result is the following
Let $L$ be a finite group, and $N$ a normal subgroup such that $\gcd(\Size{N}, \Size{L/N} ) = 1$. If the subgroup $T$ of $L$ has order dividing the order of $N$, then $T \le N$. In particular, $N$ is unique of its order, and thus characteristic in $L$.