How long after?

How long after having sex should I wait to take a pregnancy test?!