Birth control

I've recently missed a pill and had unprotected sex that same night. How soon does it stop working and is there a chance I could've gotten pregnant ?