Several train operators publish their own rules. Traditionally, the programmed time would be the "start of the wheel" time, that is, the moment when the wheels really began to move. This goes back to when the train doors were operated manually, so measuring the closing time of the door would not make much sense. This meaning is transferred to modern trains, so to allow an exit on time, the train doors are blocked anywhere between 30 seconds and one minute before departure. This must be announced by each individual operator somewhere (maybe on the schedules, maybe on your website, or maybe just on the stations). See for example this Tweet from South Western Railway (unfortunately I could not find a more official source on their website). Once the doors are closed, the train can leave when the people involved in the shipment are convinced that it is safe to do so, so in practice, a train could end up leaving approximately 45 seconds earlier in an extreme case.
In the big terminal, they can also stop announcing trains, or let people cross the doors, until a few minutes before their departure, to discourage people from running long distances through the lobby to their trains.
In addition to this, you may also be interested in knowing the minimum connection times. These are the official minimum times that you must leave for a connection to be officially valid (and, therefore, eligible for compensation and / or use of the next available train if the connection is lost). This is by default 5 minutes, but it can vary considerably depending on the season. This information can be found officially in the schedules, but a good unofficial source to use the same data as the trip planners is BRTimes. It is a bit more complicated, but it is still possible to use this site to calculate things like the minimum connections for travel through cities (eg, London) between different train stations.