How persistent does a stomach ache have to be in order for it to be appropriate to have it checked out?

It depends... It really depends on how much it bothers you. Nevertheless, increasing pain, pain accompanied by fever (>100F), or pain causing you to be unable to eat or drink should prompt medical evaluation ASAP.
Severity? A sudden excruciating stomach ache requires immediate attention. A long-standing, yet unrelenting, belly pain should be evaluated after a couple days. Of course, if other symptoms, such as bloody diarrhea, inability to keep food down, or simply an uncertain cause, should be evaluated within 48 hours. Don't take chances, see doctor ASAP.
Stomach pain. Persistant stomach pain for more than a few days should be checked out by your doctor. Mean while stop alchohol and coffee and see if it helps.