You're going on a long car trip with your friend. You're making plans for the trip with your friend, and you want to tell him what time you should leave. You say:
It's an 8-hour drive, so we should leave here by nine o'clock.
When you're describing something that takes a certain amount of time, you can describe it in this way. Here are several more examples:
A lot of people can't stand to sit through a three-hour movie.
When you invited me to participate in the conference, I didn't realize that it would be a five-day event.
I signed a two-year contract with AT&T when I got my iPhone, so I can't switch carriers for another 8 months.
Notice that the unit of time (hour, day, year, etc.) is singular. It's "an 8-hour drive", not "an 8-hours drive."
You use the phrase "leave somewhere by ___ o'clock" when you're explaining when you need to start travelling in order to arrive on time. This can be used when planning for long trips like in the example above. But it can also be used when discussing short trips.
I have to leave home by seven thirty every morning for school.
(Print this lesson)