You can leave and come back later - no one has to stay inside to keep the instance open. If your entire group leaves (or logs out) then your instance will save its state and shut down. You can come back at any time before the timer expires and continue.
If your entire group logs out while inside, it'll save and shut down too. When you log back in, you'll be at the zone-in. You can then zone back in and continue. Any mobs that repop normally will probably have repopped in your absence.
LINK