When flying on a long-haul flight, you can often see gate allocations for when you land a hour or two before actually arriving at the airport, including transfer information and connecting flights. However, with so many aircraft and frequently changing situations, how do they manage to allocate these gates so far out in advance?
Route times are pretty well known. If you know when the plane should depart and how long the flight should last, it's pretty easy to calculate when it will be arriving. Give a few minutes leeway on either side, and you should be good. If the plane is not there on time, you send it somewhere else.
Most large aircraft have some sort of ACARS that allows them to talk to company dispatch and let them know if they're going to be early or late, among other things. Barring that, they almost always have a company radio frequency that they can relay messages on one way or another.