Children develop at different rates, so the best indicator that you should stop using a baby fence is when your child tries to climb over it.
Even if your child has not tried to climb, you should stop using a baby fence when they are 2 years old.