The check engine light only comes on when the computer believes there's an actual problem. It never comes on based on mileage.
The computer will give a trouble code that indicates either the condition that brought about the code (like "Lean condition") or the system that it believes to be functioning incorrectly (like "EGR flow insufficient").
Sometimes the failed system will be electrical in nature that will result in a code like "Open or short circuit in coolant temperature sensor circuit," in which case there's likely a circuit problem either in the temperature sensor itself, or the wiring between it and the computer.
Some failures won't be in any of the above items, but will rather be a result of a poor power or ground supplies to the computer that control it's ability to think properly. In any case, whatever the problem is it needs to be diagnosed. It's not uncommon for people to mistakenly believe that our use of a computer eliminates the need for diagnosis.
The computer is a wonderful tool that aids us in diagnosis. It's useful enough that we've spent thousands of dollars buying computers and keeping them updated, but a computer is still just a tool; it's not magic, and it doesn't know everything. We are still heavily reliant on the technician's knowledge, experience, and judgement. Depending on the complexity of the system, we will normally get permission to spend a range of time and money for our initial diagnostic time.
Within that time we will do whatever we think will best further your purposes. Once we engage with it, it can go three ways. Best case scenario, we diagnose your problem and repair it. Next best, but very common, we diagnose your Toyota and then call you up with a quote for the repair. At that point you can say yes or no, however you want us to proceed. Worst case, we get to the end of our allotted time and we still haven't come to a conclusion as to the cause of the problem. This worst case is unusual, but it's a real possibility that should be acknowledged.
People often ask if we charge for diagnostic time. The answer is yes. They also ask if we still charge for diagnostic time if the agree to do the service or repair. The answer to that is that to the extent that the diagnostic efforts and the repair efforts overlap, the customer gets the full benefit of that overlap. To the extent that diagnostic efforts and the repairs are separate, they will be charged for separately. So, for instance: If we have to disassemble something in order to tell you that it's defective, then we may already be half way through the labor required for replacement, and of course you'll get the benefit of that. But, if we diagnose something that doesn't require disassembly, then the repair is a whole new activity on top of the initial diagnostic time, and you'll be charged for each individually.