Larger organisms tend to be less abundant than smaller organisms, often leading to a negative slope of the size-abundance relationship. Metabolic theory links size structure, energy use, and productivity across levels of biological organization predicting that size-abundance relationships should be invariant, with a slope of -0.75, across ecological communities. However, empirically observed size-abundance relationships can vary substantially with biotic and abiotic environmental factors. Here, we test how the size-abundance relationship is affected by temperature and biodiversity through time in a controlled experiment. We used protist microcosms across a gradient of species richness (1 to 6 species) and temperature (15 to 25° C) and tracked size-abundance relationships over six weeks of community development. While on average the expected slope of the size-abundance relationship was found, a three-way interaction between size, richness and temperature suggests that the relationship is not invariant. In low-richness communities, the temperature had relatively little effect on the abundance of small and large protists, thus resulting in no strong changes in the slope. However, in high-richness communities, the temperature increased the abundance of small protists more than that of the large protists, thus making the slope steeper. We also found that the size-abundance slope got considerably shallower across time, potentially driven by the interactions among species. Understanding drivers of the size-abundance relationship can provide novel insight into the underlying mechanisms shaping ecological communities under environmental change.