In my experience, it takes about 3-4 hours of driving to clear most codes. I recently bought a neglected 2005 X5 3.0 with every warning light lit

and I've cleared them all on their own. I have an ELM-327 with the Torque app so I could clear them, but I get an odd satisfaction seeing them go out all by themselves.