Closing a realm means that no one can join the realm, and no one can leave the realm. If the realm is closed while players are in it, they will be kicked out.