For how long has the Earth been habitable for humans?
One needs breathable air, drinkable water, and food to survive. Food as we know it was nonexistent prior to the Ediacaran, which began about 635 million years ago. Life was exceedingly primitive (single celled) prior to that. Breathable air is a more significant challenge. A breathable atmosphere means sufficient oxygen and not too much carbon dioxide. Oxygen levels rose to above half it's current amount in the atmosphere about 850 million years ago, but carbon dioxide didn't fall below 5000 ppm until about 450 million years ago, when it dropped precipitously and caused an ice age and an extinction event. Extinction events would be something to avoid, so about 440 million years ago.