There is neither a maximum nor a minimum age, and there is no “best” age for a hair transplant. The right time for someone to have a hair transplant is when they have decided they want to do something about the appearance of their hair and when they find a surgeon they can trust—not only for his knowledge but also for his aesthetic sense.
As a hair transplant surgeon, I avoid recommending hair transplants to patients who are very young, because almost always at these ages we can treat hair loss and thinning with other methods rather than a transplant. We always keep hair transplantation as the last weapon to address hair loss and thinning.