The impact of environmental fluctuation on species coexistence is critical for understanding biodiversity loss and the ecological impacts of climate change. Yet, determining how properties like the intensity, frequency, or duration of environmental variation influence species coexistence remains challenging because we lack a theoretical framework that generates testable predictions in realistic biological systems. Here, we model the impact of environmental change at different temporal scales on species coexistence in nonequilibrium systems by employing the concept of performance curves to incorporate niche differences within a stochastic Lotka-Volterra framework. We discover that short- and long-term environmental variability have contrasting effects on species coexistence, such that short-term variation favors species coexistence, whereas long-term variation promotes competitive exclusion. Consequently, we show the complex set of environmental variability and species coexistence relationships found in previous studies can all be synthesized within a general framework by explicitly considering both long- and short-term environmental variation.