Aside from relying on their extensive training, physicians have therapeutic guidelines based on scientific studies at their disposal. These guidelines are usually issued by a national medical authority for a given disease, syndrome etc.
Specifically, for antibiotics, a clinician has to take into account several factors:
- Which bacteria caused the infection?
- How severe is the infection?
- Which antibiotic is used?
- How is the patient responding to therapy?
- What are the characteristics of the individual patient (age, immune system status etc.)
For example:
- The recommendations on treating community acquired pneumonia show how guidelines differ among countries, but also that all guidelines link the type of bacteria to the duration of therapy. Another factor is patient's response to therapy (as seen in the guidelines in Canada and the US).

Source: File TM. Clinical Efficacy of Newer Agents in Short-Duration Therapy for Community-Acquired Pneumonia. Clinical Infectious Diseases.2004;39(Supplement_3):S159-S164
2a. Specifically, for otitis media in children The Royal Children's Hospital Melburne suggest an algorithm which takes into account the child's response to therapy.
2b. For the same indication, in the US he severity of symptoms and child's age are taken into account. American Academy of Pediatrics guidelines recommend:
The optimal duration of therapy for patients with AOM is uncertain; the usual 10-day course of therapy was derived from the duration of treatment of streptococcal pharyngotonsillitis. Several studies favor standard 10-day therapy over shorter courses for children younger than 2 years. [162,190–194] Thus, for children younger than 2 years and children with severe symptoms, a standard 10-day course is recommended. A 7-day course of oral antibiotic appears to be equally effective in children 2 to 5 years of age with mild or moderate AOM. For children 6 years and older with mild to moderate symptoms, a 5- to 7-day course is adequate treatment.
Source: Lieberthal AS, Carroll AE, Chonmaitree T et al. The Diagnosis and Management of Acute Otitis Media. Pediatrics.2013;131(3):e964-998