I assume that you're a passenger travelling on a flight and you want to know how long the flight will last, from takeoff to landing.
First you would need to get the route you're going to fly. Sometimes the published route is available on flight-tracking sites, for example this one. After that, you can plot the route on an aviation chart to get the distance. If the route is not available, you will need to construct the likely route by guessing which airways the flight will take.
Next you need to figure out your plane's groundspeed. The groundspeed is not constant. When the plane is climbing, part of the engine thrust is directed upwards, so ground speed would be slower. Engine thrust also varies with altitude, so the ground speed will vary throughout the climb. You will need an aircraft performance table, which typically has data at 1000 feet increments. You need to repeat the calculation for each 1000 feet until the aircraft reaches cruise altitude.
We will assume the aircraft remains at a constant cruise altitude for now. You can easily work out the flight time by looking up the cruise groundspeed (not airspeed).
Now we need to figure out when the plane will begin its descend. From the route you obtained earlier, you'd have known the flight's cruise altitude. Flights typically descend 1000 feet per 3 nautical miles. Work your way backwards from the destination, you will have your Top of Descent point. Again, the ground speed will be slower because the velocity vector has a component in the vertical direction. The plane will descend at its cruise airspeed until 10,000 feet, where it will slow to 250 knots.
For a start, this very simplified version would give you a closer estimate to reality. I have left out:
- Winds aloft. At high altitude, usually there is a significant wind blowing at one direction. Depending on whether it is head wind or tail wind, it will slow you down or speed you up. Different areas will, obviously, have different wind conditions. Different altitude in the same area will also have different wind conditions.
- SIDs and STARs. These are the waypoints which connects flights coming from all directions to a common arrival point for final approach at the destination airport (or the opposite at the departure airport). These waypoints will increase the total length of your route.
- Altitude changes. Throughout a flight, the cruise altitude may change. With a new altitude, the engine performance (hence cruise speed) will be different.
In fact, flight time estimation is so complicated that we use software to calculate them. No sane human-being will go through all the data to calculate flight time today.
Note that I did not take into account:
- Taxi time: the time it takes to move the aircraft between the gate and the runway on the ground
- Holding time: the time which flights are asked to fly in circles near the airport when the airspace is too busy
Your airline will have included these estimates in the quoted time on your flight ticket.