Everyone finds their own optimal time based on their lifestyle.
Now, if lifestyle was not an issue, meaning you can workout whenever you want to, 3-4 hours after waking up would be the best. This would be when your body's hormone levels were at their best.
The real key, if that is not an option for you, is to pick a time, and stick with it. High level athletes like Olympians, train, for the most part, at the same times every day. By doing this, your body will start to adjust and maximize hormone levels (and other things) for that time of day.