If you have had sex with an HIV-positive person who is not undetectable (what does this mean) and the condom has torn, slipped or is suddenly not there, then you have had an infection risk. This means you have the possibility of receiving post-exposure prophylaxes, also known as PEP.
PEP must be started as soon as possible after the HIV risk contact. Best is within two hours, otherwise within 24 hours, and at the latest 48 hours. Whether PEP can still be useful for up to 72 hours (three days) after the risk remains controversial.