First answer to this question would be yes, but consider the following question: How many elements has the set $\{a,\, b\}$? The answer to this question depends on $a$ and $b$:
- If $a=b$, then $\{a,\, b\}$ is a singleton.
- If $a\neq b$, then $\{a,\, b\}$ has two elements.
So is $\{a,\, b\}$ uniquely defined although its cardinality is not unique? I have two possible answers solving this problem:
Solution 1: Because of the axiom of extensionality a set is uniquely defined, iff one can say for each object whether it is element of the set or not. So $\{a,\, b\}$ is uniquely defined because one can say that an object $x$ is element of $\{a,\, b\}$, iff $x=a$ or $x=b$. The uniqueness of a set does not imply the uniqueness of its cardinality.
Solution 2: If $a$ and $b$ are in the context defined objects (which do not depend on free variables), then $\{a,\, b\}$ as well as its cardinality is uniquely defined. If $a$ and $b$ are free variables or depend on free variables, then asking for the cardinality of $\{a,\, b\}$ is the same as asking for the truth of a statement form $A(x)$ with a free variable $x$: It doesn't make sense. Just after substituting all free variables with uniquely defined objects, on can ask for the cardinality of $\{a,\, b\}$.
Which of my solutions is right or is there a better solution? What is the right answer to someone who says that the set $\{a,b\}$ is not unique?
It is true that the uniqueness of the set, meaning its well-definability, does not imply that its cardinality is unique.
To phrase that in a clearer and more accurate way, proving that a set is well-defined does not mean that we can prove its cardinality is anything in particular.
Consider the set defined as follows $\{x\in\Bbb N\mid (x=x\land\mathrm{RH})\lor(x\neq x\land\lnot\mathrm{RH})\}$. If $\mathrm{RH}$ is true, then this set is $\Bbb N$, if it is false then the set is empty.
We can prove that this set is well-defined, because we can write this expressed in the language of set theory (albeit in a complicated way), and the axiom schema of separation tells us that this is a well-defined set. Can you prove if it's empty or not? Maybe, if you can prove the Riemann Hypothesis. (Okay, so $\rm RH$ might end up provable, if you want a real doozie, replace it in the definition by something provably unprovable like the Continuum Hypothesis, or something like that.)
The first answer is correct. Extensionality proves that either this set is a pair, or it is a singleton, but it is well-defined nonetheless.