I usually try to arrive at the airport an hour before my flight. I think 1 1/2 hours is about the right time for most people (more if you're a worrier). Work you're way backward based on the train or bus schedule. You'll probably need to leave your hotel about 3 hours before your flight.
I once arrived at Narita an hour before my flight and got hit by a DHL truck as I was driving through the parking lot. Called the police, ambulance, insurance company, car dealer, and tow truck. Then waited for the tow truck to arrive. Still made my flight.