Not long. Teeth hurt from debris in between teeth (floss this out, rinse with mouthwash and brush), or decay into the dentum (not an emergency but see your dentist), or infection in the root (terribly painful , responds to ice on the tooth, may need a root canal). These should be seen by your dentist. How long to wait depends upon your pain tolerance and how much damage you will ignore.
Do not wait. See a dentist asap to avoid expense and pain. If it goes away, it usually is not the good sign people think it is. The infection is expanding and waiting can cost you the loss of your tooth.