It just depends. You can either go by what your doctor tells you or by what the pill that you are on says.
I listen to my doc who says it takes three months to be the full 99% effective. But others go by what the pill says, and some say after seven days.
But in all honesty if you do not want a baby you should always use condoms also. The pill is not 100% effective. You will get lots of people here saying,"well, I have had sex with just the pill for b/c for so many years and I am not pregnant" that is just wonderful and I am happy for those people, but people get pregnant on the pill everyday. It is not fullproof, so you need to use your better judgement. Good luck!