How long can sperm live?

My bf and I had unprotected sex 5 days before it said I should have ovulated. Is it any possible way to live that long? He did cum inside me since we aren't trying but we aren't stopping it from happening either. I'm just curious if this is even possible at all..