stop having the pill after sex?

Hello, so today is the last day I see my boyfriend till September/October. We have been dating for 3 years and we had sex yesterday but I want to stop being on the pill during the summer. I just see no point and my gyno said it was okay to stop. But I'm not sure how long after sex can you stop the pill?
If anyone knows I would greatly appreciate !