By way of example, suppose A = {1, 2, 3} and B = {a, b, c}. Then the Cartesian product of A and B is
A × B = {{1, a}, {1, b}, {1, c}, {2, a}, {2, b}, {2, c}, {3, a}, {3, b}, {3, c}}
That is, each element in A gets a pairing with each element in B, and for each pairing you have n(A) choices for the first element and n(B) choices for the second element.
So if n(A) = p and n(B) = q, then n(A × B) = pq.