Depends on the departure time of the train! Usually as Manoj Sir has said, for trains departing on and after 12 noon it is prepared some 2-3-4 hours before the departure of the train.
For trains departing in the moning, it is prepared 24 hrs prior to the departure time of the train!