Mission planners have to find a time when conditions are favourable for launch to make the launch more economical and efficient.
Satellites launched in the direction of Earth’s rotational motion (eastward) get a boost of 1700 km/h. Probes launched in the direction of Earth’s orbit get a boost of 107,000 km/h. Launching spacecraft away from Earth when direction of Earth in its orbit around the Sun corresponds with desired direction is beneficial.
The slingshot effect is also a useful mechanism that uses a planet’s gravitational field and orbital speed to help a space probe gain speed. There is a very narrow launching window and careful calculations and planning must be done so that the planets are in the right place at the right time for a rocket to use the slingshot effect.
Mission planners need to take factors such as these into account and therefore only have a small window of opportunity for a launch time.