$gh = hg, \ \gcd(|g|, |h|) = 1\Rightarrow|gh| = |g||h|\ \ (|a|$ = order of element $a)$
You can find $|gh|$ divides $|g||h|$ already from $$(gh)^{|g||h|}=g^{|g||h|}h^{|h||g|}=e^{|h|}e^{|g|}=e.$$ On the other hand, $$ e=(gh)^{|gh||h|}=g^{|gh||h|}h^{|gh||h|}=g^{|gh||h|}$$ implies $|g|$ divides $|gh||h|$. As $\gcd(|g|,|h|)=1$, we conclude $|g|$ divides $|gh|$. Similarly, $|h|$ divides $|gh|$. Again using $\gcd(|g|,|h|)=1$, we finally have $|g||h|$ divides $|gh|$.
$1 = (gh)^k\! = g^k h^k\Rightarrow\, g^k\! = h^{-k} =: \color{#c00}f\in \langle g\rangle\cap\langle h\rangle\Rightarrow\, |f|\ {\Large\vert}\ \overbrace{|g|,|h|}^{\rm coprime}\,\Rightarrow |f|=1\Rightarrow \color{#c00}{f = 1}$
So $\,\ (gh)^k = 1\iff g^k =\color{#c00} 1 = h^k\!\iff |g|,|h|\mid k\iff\! |g|\,|h|\mid k,\,$ thus $\,|gh| = |g||h|$