Injection

I have been on the injection over 2 weeks and my boyfriend did not pull out. Is it impossible for me to be pregnant? How long does it take for the injection to work?