You can only get pregnant when you are ovulating, which is normally in the middle of your cycle (usually day 14 of a 28 day cycle).
However, some people ovulate at different times. Men's sperm
can remain active for up to 2-3 days. With so many variations and irregularities, it is safe to assume that you could get pregnant anytime you have unprotected intercourse.