This turns out to be an application of the multiplication principle for counting things.
For example, suppose we want to count (or find all of) the divisors of n = 144.
Begin by forming the prime factorization of 144:
144 = 2^{4 .} 3^{2}.
So any divisor of 144 must be a product of some number of 2's (between 0 and 4) and some number of 3's (between 0 and 2). So here's a table of the possibilities:
2^{0} | 2^{1} | 2^{2} | 2^{3} | 2^{4} | |
3^{0} | 1 | 2 | 4 | 8 | 16 |
3^{1} | 3 | 6 | 12 | 24 | 48 |
3^{2} | 9 | 18 | 36 | 72 | 144 |
From the table, it's easy to see that there are 5 x 3 = 15 divisors of 144.
In general, if you have the prime factorization of the number n, then to calculate how many divisors it has, you take all the exponents in the factorization, add 1 to each, and then multiply these "exponents + 1"s together.