HOW LONG SHOULD I WAIT TO HAVE UNPROTECTED SEX?

Hi girls!!! Im 2 weekd taking my pills, almost at the same hour, i take the at 3:30 but sometimes i miss them 30-40 minutes. My doctor say its alright but i have to be carefull not to miss them.
I wanted to know, How long shoud i wait to have unprotected sex so the pills can make their job? I have read that they work at the first day but im not pretty sure. 
Thanks 😽