As lhf said, if $a$ and $b$ have no common divisors (other than 1, that is $\gcd(a, b) = 1$), then
$$\tau(ab) = \tau(a) \cdot \tau(b)$$
Where $\tau(n)$ is the number of positive divisors of $n$. However, when they do have common divisors, it is not as simple. There is, however a general way to do calculate $\tau(n)$ if you know the prime factorization of n:
$$n = {p_1}^{\alpha_1} {p_2}^{\alpha_2} \ldots {p_n}^{\alpha_n}$$
All divisors are then of the form:
$$d = {p_1}^{\beta_1} {p_2}^{\beta_2} \ldots {p_n}^{\beta_n}$$
With $0 \le \beta_i \le \alpha_i$. Thus, each $\beta_i$ can be chosen in $\alpha_i + 1$ different ways, and by the multiplicative principle:
$$\tau(n) = (\alpha_1 + 1)(\alpha_2 + 1) \ldots (\alpha_n + 1)$$
Since you can easily find the prime factorization $ab$ if you know the prime factorization of $a$ and $b$ (by just adding the exponents), I think this would answer your question. Also note that the property noted by lhf can easily be showed from this formula, because two numbers are coprime if and only if they don't share any prime factors.