Birth control

To anyone who has switched birth control pills how long do you have to be on the new pill to be protected?