A and B are equal only if A and B contain exactly the same elements.
n(A) = n(B) is a necessary condition for the sets A and B to be equal but it is not a sufficient condition.
For example A=(1,2,3} and B= {a,b,c} are not equal but n(A) = n(B) = 3
So the answer to the question is if n(A) = n(B) then A and B can be equal but are not necessarily equal.