With locked teams when you get the victory screen the game is over, you cannot do anything else except, take over the remaining planets and kill off the remaining enemies.
With unlocked teams, the AI should have automatically un allied with you and depending on how many allies are allowed for victory, you either win and end up in just clean up mode, or you proceed to kill them off until you do get the victory screen.