Will give you a reasonable idea most times, however some horses will have ecessive wear making them appear older, or minimised wear making them appear younger than they really are. Of course there are also ways of falsifying tooth ages ("Bishoping") so again, what the teeth say may not ALWAYS be the truth!
I had the horse dentist out to my pony shortly after I had bought him. I hadn't mentioned his age to the dentist and asked if he could tell how old he was - his answer was "well, I think he is just about what you thought he was" .... lol
I recently bought a pony that I suspected might be older than the passport stated. I had to take her to the dentist as she needed sedation & he said straight away on looking in her mouth that she was 20+. Only around five years older than I'd hoped, but not great news all the same. On a positive, her teeth were in better condition than I suspected.