Pregnancy test

How long should you wait to take a pregnancy test ? (Has protected sex 2 hours ago but it kinda slipped off and I’m scared)