Oblivion Gates tied to the main quest remain until you complete the relevant story sequence. Random gates can respawn, and the game generally caps the number of active random gates at around sixty. Many players leave them open because they provide useful combat experience.