Add a new option to the database using
add_option( 'max_class_size', 12 );
Then, edit your code and get the number of already registered users, the same way the emails get the no, and do something like
if ( $no_of_users >= get_option( 'max_class_size' ) ){
}
else
{
}