What breaks down when generalising from sets to classes? I have been familiarising myself recently with some basic definitions in category theory, where we work with classes of objects and morphisms, as opposed to just sets. It feels like I am long overdue trying to understand exactly what differences there are between sets and proper classes i.e. which properties we take for granted with sets no longer hold in this more general setting.
Since I don't have any rigorous definition of what a class is (or even a set for that matter, I have not studied axiomatic set theory), what should I know about classes to avoid making false assumptions in category theory?
For example:

*

*Do two classes $A$ and $B$ have a well-defined product class $A\times B$?

*Given a class $A$, can we form a 'power class' $\mathcal{P}(A)$ consisting of its subclasses?

*Can we define partial orders on classes in the same way we can for sets? (I remember being told that 'isomorphism' is an equivalence relation as an undergrad.)

I suspect the answer to all of the above is 'yes'. The only practical difference I have encountered so far seems to be that proper classes are simply too 'large' to be sets i.e. they do not have a well-defined cardinality. But can we still compare the relative sizes of two classes in some meaningful way?
In short, what things should I look out for when working with non-small categories?
 A: The interpretation that proper classes are simply too "large" does not only entail that they do not have a well-defined cardinality, but also that they cannot squeeze inside another class/element. If $A$ is a class (proper or not) and $B \in A$, then $B$ must be a set. In other words, a proper class is not an element of any class.
When discussing classes, we usually do it under NBG Set Theory, which is just a little bit different from the usual ZFC Set Theory that you probably hear about all the time. Regardless, the theories $\mathsf{NBG}$ (with choice) and $\mathsf{ZFC}$ are so similar that in many cases we do not have to distinguish them apart - see this post.
Thus, to answer your questions (under $\mathsf{NBG}$):

*

*Yes. This is a consequence of Axiom of Comprehension.


*No, as by definition we must have $A \in \mathcal{P}(A)$, which implies that the proper class $A$ is an element of some class.


*Yes. If $A$ is a proper class and $\leq$ is a partial order on $A$, then $\leq \; \subseteq A \times A$ (all elements of $\leq$ are sets).
A: The idea that proper classes are big while sets are small is in fact equivalent to the axiom of choice (you can find a proof in my question here)
Because of that I'll try to give an answer without refering to "size".
We can view stuff from 2 perspectives:
Semantically: Let $V$ be the universe, given a model $M$ (for ease, say it is transitive) of $ZF$ inside of $V$, a "(full semantics) class$^M$" is a subset of $M$, a "(full semantics) proper class$^M$" is a subset of $M$ that is not a member of $M$.
Syntactically: (in a $ZF$-style theory) a "class" is a formula $\phi$, a "proper class" is a class $\phi$ such that $\{x\mid \phi(x)\}$ is not a set, when we say $C$ is a class and $a\in C$ we mean $C(x)$

Semantically, stuff that "works on sets but not on proper classes" are:

*

*operator $p$ such that if $x\in M$ so is $p(x)\in M$ but if $x\subseteq M$ does not imply $p(x)\subseteq M$.

So for example (assuming for convenience sake that $M$ is a model of $ZF2$, second order $ZF$), let $p$ be the real $\mathcal P$ operator. Clearly $p(M)$ is not a subset of $M$, but $p$ does send elements from $M$ to elements from $M$ (notice that we must be careful here, because our operators must be from $V$, and not from $M$, as proper classes are not part of the model)


*A formula $\phi$ such $M$ thinks it is always true, but $V$ thinks that it sometimes fails on the powerset of $M$
For example, let $M$ be $V_\kappa$ for inaccessible $\kappa$ (which is a model of $ZF2$) (ignore the complications of defining inaccessibles without AC), and assume that the first failure of AC is on rank $\kappa$, in this case, AC is true in $M$, but fails on proper classes of $M$.

Syntactically we cannot say a lot.
And not as an expression or anything, I mean that in a formal sense.
We cannot quantify over proper classes, so any sentence of the form $\forall x$ or $\exists y$ cannot (generally) be translated to sentence about classes.  We also need to change every $x\in C$ to $C(x)$.
In this sense we cannot even state $\forall X (\mathcal P(X)\text{ exists})$, but given a formula $C$ we can express $\phi(C)=\mathcal P(C)\text{ exists}$, and in fact, for each $C$, $\phi(C)$ is true, after suitable change of the definition of powerset, Let $Pc(x)=\forall y\in x(C(y))$, and after the change of definitions I said before, we get that $Pc$ is the power"set" of $C$ (remember that $C$ is fixed, so we can define this $Pc$)
A: An alternative to the NBG theory espoused in another answer is the theory of Grothendieck universes, according to which "class" is literally just a name for an unusually large set, we never consider such a collection as "all sets whatsoever", and all constructions available for sets are (thus) available for "classes".
A: What you should know is, that it is never a good idea to talk about such a think as a category of all categories or a category of all sets, etc. Cause then you might ask, isn’t $\mathtt{Cat}$ itself a category in $\mathtt {Cat}$, and aren’t the objects of $\mathtt{Set}$ themselves a set, and thus an object of the category of sets?
Questions like isn’t the category of all categories one of the categories in the category of all categories are the kind of questions which lead you into trouble. Always only consider constructions as such up to a certain size level.
Say you fix a cardinal $\kappa$. Then there is no question that you get a well defined category of sets with cardinals bellow $\kappa$. But now maybe you like you category of sets to be closed under taking coproducts. That is if $A$ and $B$ have cardinality below $\kappa$, then so has $A+B$. Here any infinite cardinal will work. But maybe you want your category of sets also be closed under other operations, like taking power sets and exponentials and having a natural number object, products, limits of sizes below $\kappa$, etc. If you add all those requirements, then you land exactly at the concept of a Grothendieck universe. You can not proof in say ZFC (or a naive set theory) that Grothendieck universes exist, you have to assume they do.
Edit: What I want to say is that you shouldn’t work with classes, you should work with a countable hierarchy of Grothendieck universes as most successful proof assistants (Coq, Lean) do. Working with classes is awkward. You have a new primitive entity in your language, and as your question shows it is a priori unclear what kind of operations you can though with them. Also the semantics of classes and sets do not differ that much. When you picture a class in your head, I bet what you see is the same as what you see when you see picture a very large set. It is bad to have two words thus two distinct set of rules for what in naive semantic is basically the same concept. When you use universes, all of the trouble goes away. Classes are just sets of a larger universe than the one you are working with at the moment. You can do anything with them what you can do with sets, and thus you will feel comfortable all the time when making your arguments.
You pay for the extension with a strictly stronger consistency strength. It is in principle conceivable that ZFC without universes is consistent, but ZFC + universes is not. But on the other hand universes do much more than classes. You add classes to be able to talk about large categories as for example Top or Set. But once you have them you quickly start to construct categories which are large and also locally large such as the functor category Fun(Top,Set). But once you have categories which are locally large, you can no longer form functor categories, and you are again in trouble. This is a general theme: In mathematics there is a tendency to look at all the things you have worked with before and view them as one entity among others of a similar kind. This is a kind of zooming out move. For example you may start doing math about numbers, but quickly you like to talk about number systems and you introduce sets and functions between them to do that. Next you realise that your number systems form a system themselves, a category of say commutative rings, and you like to compare it to other such systems like for example the category topological spaces via functors. You have zoomed out one more step. A good foundation should allow you to zoom out whenever you like, because mathematicians who don’t care about foundations will do it anyway. People worked with functor categories and categories before the foundations where settle, because it just makes sense. Adding classes allows to make one more zooming out step than sets, but you are quickly standing before the same problem, so it is not a good solution.
