It is generally accepted that the very first stars in the universe were significantly more massive and formed much more in isolation than stars observed today. This suggests that there was a transition in star formation modes that was most likely related to the metallicity of the star-forming environment. We study how the addition of heavy elements alters the dynamics of collapsing gas by performing a series of numerical simulations of primordial star formation with various levels of pre-enrichment, using the adaptive mesh refinement, hydrodynamic + N-body code, Enzo. At high redshifts, the process of star formation is heavily influenced by the cosmic microwave background (CMB), which creates a temperature floor for the gas. Our results show that cloud-collapse can follow three distinct paths, depending on the metallicity. For very low metallicities (log10(Z/Z⊙) < −3.5), star formation proceeds in the primordial mode, producing only massive, singular objects. For high metallicities (log10(Z/Z⊙) > −3), efficient cooling from the metals cools the gas to the CMB temperature when the core density is still very low. When the gas temperature reaches the CMB temperature, the core becomes very thermally stable, and further fragmentation is heavily suppressed. In our simulations with log10(Z/Z⊙) > −3, only a single object forms with a mass-scale of a few hundred M⊙. We refer to this as the CMB-regulated star formation mode. For metallicities between these two limits (−3.5 < log10(Z/Z⊙) < −3), the gas cools efficiently, but never reaches the CMB temperature. In this mode, termed the metallicity-regulated star formation mode, the minimum gas temperature is reached at much higher densities, allowing the core to fragment and form multiple objects with mass-scales of only a few M⊙. Our results imply that the stellar initial mass function was top-heavy at very high redshift due to stars forming in the CMB-regulated mode. As the CMB temperature lowers with time, the metallicity-regulated star formation mode (producing multiple low-mass stars) operates at higher metallicities and eventually becomes the sole mode of star formation.