Most space flights take about ten days.
But preparing for the flight takes more than a year. They also attend classes on shuttle systems, mathematics, guidance and navigation, orbital dynamics, materials processing, and other subjects. Once assigned to a mission, the training becomes more specific to that flight, covering everything from docking to a contingency space walk. Ninety percent of the training is for that type of situation. They pile failure on failure in simulations, so that we will be prepared if an actual failure were to occur in flight.