Dentists typically fill cavities during a scheduled appointment, but the timing can vary based on the severity of the cavity, the dentist's schedule, and the patient's preferences.