The system usually needs a few driving cycles (meaning starting the car, driving for a while, and turning it off) to confirm the problem is solved before it turns off the check engine light. This could be as little as one driving cycle or a couple of days of driving. Mileage driven is irrelevant; it's about driving cycles and the system detecting that the fault has cleared.