Pregnancy test?

How many days after sex should I take a pregnancy test? Or should I wait until my period is late?