Right Time

When is the right time to take a pregnancy test? I never know when I should or shouldn't take one. Especially like how long after the male ejaculates inside you?