We investigate the timescale over which the infrared (IR) luminosity decreases after a complete and rapid quenching of star formation using observations of local and high-redshift galaxies. From spectral energy distribution modelling, we derive the time since quenching of a subsample of 14 galaxies from the Herschel Reference Survey that suffer from ram-pressure stripping due to the environment of the Virgo cluster and of a subsample of 7 rapidly quenched COSMOS galaxies selected through a state-of-the-art statistical method already tested on the determination of galaxy star formation history (SFH). Three out of the seven COSMOS galaxies have an optical spectrum with no emission line, confirming their quenched nature. We obtained the present physical properties of the combined sample (local plus high-redshift) from the long-term SFH properties, as well as the past LIR of these galaxies just before their quenching. We show that this past LIR is consistent with the LIR of reference samples of normally star-forming galaxies with same stellar mass and redshift as each of our quenched galaxies. We put constraints on the present to past IR luminosity ratio as a function of quenching time. The two samples probe different dynamical ranges in terms of quenching age with the HRS galaxies exhibiting longer timescales (0.2–3 Gyr) compared to the COSMOS ones (< 100 Myr). Assuming an exponential decrease in the LIR after quenching, the COSMOS quenched galaxies are consistent with short e-folding times of less than a couple of hundred million years, while the properties of the HRS quenched galaxies are compatible with larger timescales of several hundred million years. For the HRS sample, this result is consistent with the known quenching mechanism that affected them, namely ram pressure stripping due to the environment. For the COSMOS sample, different quenching processes are acting on short to intermediate timescales. Processes such as galaxy mergers, disk instabilities, and environmental effects can produce such strong star formation variability.