How long can sperm stay in your system?

If you have sex before your most fertile day will the sperm till be viable in a couple days ?