Theoretically, it's 2mm of tread left on the tyre (using the wear indicators as a reference). In reality, i.e. on the line, so long as there are no threads showing it's fine. It should be changed as soon as threads become visible. Even if there are threads showing there's a good inch or more of rubber compound, metal thread, nylon thread etc so don't worry!