According to the Home Ventilation Institute (HVI) the exhaust fan should run for at least 20 minutes after the shower has been used. This ensures that the proper amount of ventilation has occurred.
You should only run the fan for about 20 minutes during and after a bath or shower. You especially shouldn’t leave it on at night. If it’s run too long, it can cause serious problems and become a fire hazard.