Dishwashers typically come equipped with a control that will regulate how long the dishwasher runs. They also have sensors that can detect how much soil is present on the dishes, which allows the dishwasher to know how much water to dispense and how long to run the cycle for.
Most dishwashers have a “quick wash” that will run 30 to 60 minutes, a typical “normal” cycle that runs about 90 to 120 minutes and a “heavy-duty” cycle can last up to four hours. Some options, like heated dry, add time so check your settings if you want a shorter wash. Your home and hot water heater temperatures can significantly alter run time.