First, there are two different methods of regulating traffic. First, there is the CTOT or "Calculated takeoff time". This is time when flight should be airborne, and is derived from all the airspaces the flight will go through to ensure that any those airspace will not get too congested. So, it is well possible that a flight from say London to Rome is kept on ground because certain ATC sector in northern France has a lot of flights planned to fly over it at the same time. Not all the flights are given a CTOT time. By changing the route or the planned altitude a little the flight may get rid of the CTOT. Flight dispatchers are responsible of this.
Secondly, at many busy airports, there is TSAT or "Target start-up time". As the name implies, this is the time that the flight should leave the gate. The purpose of TSAT is to shorten the queues at the runway holding point. It is better to wait at the gate than wait with engines running.
If flight also has a CTOT, TSAT time is adjusted accordingly so that if flight leaves the gate in time it should be ready at the end of the runway at CTOT time. TSAT time is set only by the departure airport so usually when it is in force, all flights are given a TSAT time. If they miss it, they will wait at the gate until they get a new TSAT. Usually it is soon, but sometimes there can be significant delay if there is lots of outbound traffic. This might be also true if flight has also missed its CTOT due to not being ready at the required time.
The methods of communicating these times to cockpit vary a lot. ATC gives the times when the crew asks for enroute clearance at the gate. Also, in my company we get an ACARS message every time our CTOT time, if any, changes. Then, on the cockpit laptop we have a application that shows all the TSAT times in our home base. More than that, if there is a quick improvement and the flight has to leave pronto, the operations center will call the the plane on the company VHF frequency to inform about the immediate change. And on many airports, the TSAT time is displayed on Visual Docking Guidance System (VDGS) screen. And finally there is the gate agent who manages the turnaround, who should be aware of the current TSAT.