It goes into your PC box.
You catch the first Pokemon you meet on a new route/ area, and as you do this for every route, your PC will fill up with Pokemon. Then, when one of your Pokemon faints, you replace the fainted Pokemon with something from your PC.
Within Nuzlocke rules, you can also decide to use one of those boxed Pokemon, and swap them out for a current team member.
EDIT: I wanted to edit & accidentally clicked hide; sorry. .__,