Groups and clusters of galaxies are a current focus of astronomical research owing to their role in determining the environmental effects on galaxies and the constraints they provide to cosmology. The eROSITA X-ray telescope on board the Spectrum Roentgen Gamma observatory will be launched in 2019 and will have completed eight scans of the full sky when 4MOST starts operating. The experiment will detect groups and clusters of galaxies through X-ray emission from the hot intergalactic medium. The purpose of the 4MOST eROSITA Galaxy Cluster Redshift Survey is to provide spectroscopic redshifts of the optical counterparts to the X-ray emission from 40,000 groups and clusters of galaxies so as to perform dynamical estimates of the total mass and to measure the properties of the member galaxies. The survey aims to obtain precise redshift measurements of the photometrically identified brightest cluster galaxies at redshift $z > 0.7$. At lower redshifts ($z < 0.7$), the programme aims to sample over 15 member galaxies per cluster and enable dynamical mass measurements to calibrate the clusters for cosmological experiments. At $z < 0.2$, eROSITA will also detect X-ray emission from galaxy groups and filaments. 4MOST spectroscopic data from the survey will be used for optical identification of galaxy groups down to eROSITA's mass detection limits of $10^{13} M_\odot$, as well as the detection of the largest filaments for pioneering studies of their X-ray emission.