A class is a named group of students who are already yours. You cannot invite anyone into a class directly: invite the student first, and only then add them to a class. One student can belong to several classes at once, and adding them to a second class takes nothing away from the first.
Assigning a task to a class is a snapshot. At the moment you press send, the task goes to everyone who is in the class right then. A student who joins the class afterwards gets nothing — send the task to them separately.
Students who are already doing this task are skipped, and if that is true of everyone in a class, the whole class is skipped. The only sign of it is a short note in the confirmation saying how many students or classes are already doing the task, so it is worth reading before you close the dialog.
Removing a student from a class does not cancel their tasks — what they already received stays with them. Removing a student from your students is different: that cancels every task you assigned to them.
Deleting a class cancels the class’s tasks. They disappear from the students’ lists and cannot be continued. What the students had already done is not erased, but you will no longer be able to send them on with that assignment, so cancel or wait out the current tasks before you delete a class.
There is no limit on how many classes you keep or how many students you put in one.