Best time to test

When is the best time to test for pregnancy after sex/how long should I wait?