The formula
Time = distance ÷ speed. Dividing the total distance by the average speed you expect to maintain over the whole trip gives the time required, expressed in hours (and fractions of an hour, which convert to minutes).
A worked example
A 240 km trip at a steady average of 80 km/h takes 240 ÷ 80 = 3 hours exactly. A longer 450 km trip at a slightly faster 90 km/h average takes 450 ÷ 90 = 5 hours — notice that despite covering nearly double the distance, the higher average speed keeps the time from scaling up by the same proportion.
Why the speed you plug in matters more than the formula itself
The formula itself is simple division, but the result is only as good as the average speed estimate — a highway-heavy route might realistically average 90-100 km/h, while a route through city traffic or hilly terrain might average closer to 40-50 km/h despite having the same posted speed limits. Using an optimistic speed (like the posted limit) instead of a realistic average is the single most common way this kind of estimate goes wrong.
Converting the decimal-hours result into a clock estimate
A result like "3 hours" is straightforward, but a result like "2.75 hours" is easier to plan around once converted: 0.75 hours is 45 minutes, so 2.75 hours means 2 hours and 45 minutes. Multiplying the decimal portion by 60 converts it to minutes.
Why this is a lower-bound estimate, not a guarantee
This calculation assumes a single, consistent average speed for the entire trip and doesn't account for stops, traffic delays, or variable conditions along the route — it's best used as a baseline estimate for pure driving time, with extra time added separately for anything that would slow the trip below the assumed average.