I think this is better understood in terms of "invariants" and "complete invariants".
Informally speaking, an "invariant" for a category $\mathscr{C}$ is a function $f$ from $\mathrm{Ob}(\mathscr{C})$ to some specified set or class $X$, with the property that if $A\cong B$ in $\mathscr{C}$ then $f(A)=f(B)$ in $X$. That is, equality of $f$ is a necessary condition for $A$ and $B$ to be isomorphic.
Usually, you want the computation of $f(A)$ and $f(B)$ to be much simpler than trying to determine whether any of the elements of $\mathcal{C}(A,B)$ are invertible. Usually there is a trade-off: the easier it is to compute $f$, the more information you should lose in the process, so that the condition $f(A)=f(B)$ tends to be weaker; that is, the equivalence relation on $\mathrm{Ob}(\mathscr{C})$ is coarser. (You can replace $X$ with a category, and then require $f(A)\cong f(B)$. In that situation, you may even have that $f$ is a functor, which may facilitate the computation of $f$.)
For example, the fundamental group of a topological space is an invariant: homeomorphic spaces will necessarily have (isomorphic) fundamental groups; but two spaces with isomorphic fundamental groups need not be homeomorphic. Likewise, the cardinality of a finite group is an invariant, but groups with the same cardinality need not be isomorphic. Another example is the Alexander polynomial of a knot (or the Jones polynomial of a knot).
Ideally, you want a "complete invariant". A complete invariant is an invariant in which the implication goes both ways: that is, $A\cong B$ if and only if $f(A)=f(B)$; or in the more general situation, if $f(A)\cong f(B)$.
In $\mathsf{Set}$, the cardinality is a complete invariant: two sets are isomorphic if and only if they have the same cardinality. The amazing thing in $\mathsf{Vec}_F$, the category of vector spaces over the field $F$, is that "dimension" is likewise a complete invariant, so that two vector spaces over $F$ are isomorphic if and only if they have the same dimension. But this is no longer true in more general categories, such as the category of all vector spaces (where vector spaces over different fields are not even "connected"), or to modules over rings.