They stay with Professor Oak in the Kanto Region. They just stay in his lab or Ash sets them free. They can come back to him anytime he wants to use them in the Elite Four. For the start until the Elite 4, he uses his new Pokémon.
Source(s): Experience with the anime.