depo shot

Does anyone know after how many days/week does the depo shot start to be affective? I got it on my postpartum appointment and was told to wait a week before having sex or to use condoms.
Also, has anyone gotten pregnant while on the first 3 months of using this birth control? 
Thank you in advance 😊 ! 

I gave birth on January 13th, got the shot on February 13th had unprotected sex on February 20th (1 week after the shot) and got what I thought was my first period on February 25th .