Crossing over occurs during meiosis, specifically in the prophase I stage. At this stage, homologous chromosomes pair up tightly in a process called synapsis, forming tetrads. The nonsister chromatids of these homologous chromosomes exchange segments of genetic material. This exchange happens at regions called chiasmata, resulting in recombinant chromosomes with new combinations of alleles. Thus, crossing over takes place during prophase I of meiosis, before the chromosomes line up along the metaphase plate in metaphase I. It is a crucial step for generating genetic diversity in gametes by mixing genetic material from the mother and father chromosomes.