TITLE: Classifying whether a collection of objects is a set
QUESTION [10 upvotes]: I'm wondering whether or not there is a definite criterion for determining whether a collection of objects is a set. In the literature, I've recently encountered some obscure examples (in Riemann Surface Theory, to be precise) of naturally-arising collections of objects which are not sets. 
Here is some pseudo-rigor to make the question more precise: 
Let $S$ be a collection of objects. Is there some property $P$ so that $S$ is a set iff $S$ has property $P$?

REPLY [4 votes]: In ZF and related theories, as indicated in another answer, the key to whether a class is a set is whether it has a rank, meaning that it appears at some point in the process of forming sets by starting with the empty set and iterating (throughout the ordinals) the operations of taking power sets and collecting what you have so far.  
The drawback of the above is that some working knowledge of ordinals is needed even to understand the statement. However, as a corollary, there is a different criterion that is also useful in practice. To state it, we need the notion of transitive closure. The thing to keep in mind is that in ZF every actual object is a set. Given a class $x_0=x$, its elements are sets and so we can collect them together by taking the union of $x$, $x_1=\bigcup x_0$. The elements of the elements of $x$ are also sets, so we can collect them together by considering $x_2=\bigcup x_1$, etc. Let $x_\infty=\bigcup_{n\in\mathbb N}x_n$. This is the transitive closure of $x_0$.
Ok, the criterion:

A class $X$ is a set if and only if there is a bound on the size of the members of $X_\infty$.

This is useful in practice: The class of all countable groups, for instance, is a proper class. It is true that all such groups are bounded in size, but their elements don't need to be: Given any group $G$, you can pick a monstruously large set $M$ and obtain a group isomorphic to $G$ simply by replacing the identity of $G$ with $M$.
Many natural classes appearing in practice are closed under isomorphism, and a similar silly construction as in the example above shows that they are proper classes. 

(The universe of all sets can be stratified according to rank, for any ordinal $\alpha$, the set of all sets of rank smaller than $\alpha$ is denoted $V_\alpha$, and any set belongs to some $V_\alpha$.
Sets can also be stratified according to the size of their transitive closure. For any cardinal $\kappa$, the sets $x$ whose transitive closure has size strictly smaller than $\kappa$ is denoted $H(\kappa)$ or $H_\kappa$, and any set belongs to some $H_\kappa$. There is a small technicality that doesn't come into play in the above; see here.)