How soon

I don't have regular periods at all. I can go 2 month, 5 months or 3 weeks. But on birth control I had vlood period every day for almost a year. So the doctor thought it was better off.. however I had sex without a condom. He did pull out but we still want to check. How long should I wait before taking a pregnancy test