What is the meaning of set in Theorem3.1 of ALGEBRA by Thomas W. Hungerford? What happens if I choose class instead of set in part (ii) of this theorem?
AND  essentially what is the difference between a set and a class?

 A: If $fh=1_B$ then $f$ needs to be surjective since $ran(1_B)\subseteq ran(f).$ So this direction is too trivial to have anything to do with size.
In the other direction, if we have a surjection $f$ and want to invert it, the idea is that we can send each point in the range back to some point in its pre-image. However, this requires the axiom of choice in general, since there is no canonical way to choose which pre-image.
And this is also where set vs. class ostensibly comes into the picture. (I'm not sure precisely what class/set theory Hungerford is using or how rigorous he's being.) The axiom of choice only says we can well-order any set, not any class. So if we want to use choice define our inverse to take each element back to its least preimage in some well-ordering, we need $A$ to be a set.
On the other hand, if we have global choice rather than just local choice, we can well-order any class, and invert a class surjection.
As for the difference between classes and sets, that’s a broader question. Briefly, the idea is that classes are collections of sets, but only some classes are sets themselves. They can generally be thought of as "too large" to be sets. For instance, the class of all sets is a class, but is not a set. (A class that is not a set is called a proper class.) Formally, the distinguishing feature in most class-set theories is that sets can be elements of classes and proper classes cannot. So sets are the classes $x$ that obey the predicate $\exists y\; x\in y.$ The axioms are largely concerned with asserting certain classes are sets, e.g. the power set axiom asserts that the class of all subsets of a set is a set.
It is a bit difficult to get across the subtlety and motivation in a brief answer here: I’m sure it’s at least partially explained in the book and that there are other answers on this site and elsewhere you can search for that go deep into the distinction between classes and sets.
