This is a very interesting problem, in my opinion.
As I see it, the answer here is.
Let $m,n\in\mathbb{Z}$, $m\geq1$, $n\geq1$.
The number of connected components of
$$
G=\{(u,v)\in\mathbb{C}^*\times\mathbb{C}^*\mid u^mv^n=1\}\tag1
$$
is $d=\gcd(m,n)$.
Let us denote the group $\mathbb{C}^*\times\mathbb{C}^*$ by $F$, for brevity.
First of all, note that $G$ is a closed subgroup of the group $F$.
Next,
$$
G_0=\{(z^n,z^{-m})\mid z\in\mathbb{C}^*\}\tag2
$$
is a connected subgroup of $G$ and $\dim G_0=2$.
It follows that $\dim G\geq2$.
On the other hand, if $H=\{(1,v)\mid v\in\mathbb{C}^*\}$,
then the intersection $G\cap H$ is a finite set.
Hence $\dim F/G\geq2$. Thus, $\dim G=2$ and $G_0$ is the component of $1$ in $G$.
Consequently, the number of connected components of $G$ is equal to $|G:G_0|$ (the index of $G_0$ in $G$).
Now let's look at a few special cases.
- Let $m=n$. This is a case from @Chad K's comment.
In this case $G_0=\{(z,z^{-1})\}$ and $|G:G_0|=n$.
The last equality follows from the fact that if
$$
D=\{(1,\varepsilon_n^k)\mid k=0,1\ldots,n-1\},
$$
where $\varepsilon_n$ is a primitive $n$th root of unity, then
$D\cap G_0=\{e\}$, $|D|=n$ ($e$ is an identity element of a group, here $e=(1,1)$),
and $D<G$. Hence $DG_0\leq G$.
In fact, $DG_0=G$, since if $(u,v)\in G$, then $(uv)^n=1$ i.e. $uv=\varepsilon_n^k$ for some $k\in\{0,1,\ldots,n-1\}$ and
$$
(u,v)=(1,\varepsilon_n^k)(z,z^{-1}),
$$
where $z=u$.
It follows that $|G:G_0|=n$.
- If $\gcd(m,n)=1$, then $G$ is connected.
We will prove that in this case $G=G_0$.
Let $(u,v)\in G$ and let $u_0$ (resp. $v_0$) be an $n$th (resp. $m$th) root of $u$ (resp. $v$).
We have
$$
(u_0v_0)^{mn}=u^mv^n=1\ \Rightarrow\ u_0v_0=\varepsilon_{mn}^k\tag3
$$
for some $k\in\{0,1,\ldots,mn-1\}$.
Since $m$ and $n$ are relatively prime there exist such integers $r$ and $s$ that
$$
\varepsilon_{mn}=\varepsilon_{m}^r\varepsilon_n^s.
$$
Hence and from $(3)$ it follows that
$$
u_0v_0=\varepsilon_{m}^{kr}\varepsilon_n^{ks}\ \Rightarrow\ u_0\varepsilon_{n}^{-ks}v_0\varepsilon_{m}^{-kr}=1.
$$
If $z=u_0\varepsilon_{n}^{-ks}$, then $z^{-1}=v_0\varepsilon_{m}^{-kr}$ and
$(z^n,z^{-m})=(u,v)\in G_0$ (see $(2)$).
- If $\gcd(m,n)=1$ and $d>1$ is a integer and $d$ is relatively prime to $m$,
and
$$
G=\{(u,v)\in\mathbb{C}^*\times\mathbb{C}^*\mid u^{dm}v^{dn}=1\}\tag4
$$
and $G_0$ is defined by $(2)$, then
$|G:G_0|=d$.
As proved in item 2 $G_0=\{(u,v)\in F\mid u^mv^n=1\}$.
If
$$
D=\{(\varepsilon_d^k,1)\mid k=0,1\ldots,d-1\},
$$
then $|D|=d$, $D<G$, $D\cap G_0=\{e\}$, and $DG_0=G$.
The latter is proved in the same way as in 1.
It follows that $|G:G_0|=d$.
- General case.
Let $\gcd(m,n)=1$ and $d>1$ be integer.
If $G$ is defined by $(4)$ and $G_0$ is defined by $(2)$, then
$|G:G_0|=d$.
Let us represent $d$ in the form
$$
d=p_1^{\alpha_1}\ldots p_s^{\alpha_s}q_1^{\beta_1}\ldots q_t^{\beta_t}d'.
$$
Here $p_i$, $q_j$ are prime,
$p_i$ is a divisor of $m$, $q_j$ is a divisor of $n$ for every $i,j$ and $d'$ is relatively prime to $m$ and $n$.
Denote by
$$
p=p_1^{\alpha_1}\ldots p_s^{\alpha_s},\
q=q_1^{\beta_1}\ldots q_t^{\beta_t}d'.
$$
It is clear $p$ is relatively prime to $n$ and $q$ is relatively prime to $m$.
Let
$$
D_1=\{(1,\varepsilon_p^k)\mid k=0,1,\ldots,p-1\},\
D_2=\{(\varepsilon_q^k,1)\mid k=0,1,\ldots,q-1\},
$$
and $D=D_1D_2$.
We have $D<G$, $|D|=d$, $D\cap G_0=\{e\}$, and $G=DG_0$.
All the checks are similar to those discussed in $1$-$3$.
It follows that $|G:G_0|=d$.
Conclusion.
If $M$ and $N$ are integers not less than $1$ and $d=\gcd(M,N)$, then assuming $m=M/d$, $n=N/d$ we get relatively prime $m$ and $n$ and further apply one of the considered items.
PS This ended up being pretty lengthy, so hopefully I didn't miss anything.
I am happy to answer any questions you may have.