Periods 8 days late

My periods 8 days late, I had sex the day before it was due so 9 days ago, and I'm not sure if my periods late because of weight loss and I stopped my pill over a month ago, should I do a pregnancy test? When should I do it?