Pregnancy test

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