We numerically investigate the evolution of gaseous haloes around disc galaxies in different environments, ranging from small groups to rich clusters, in order to understand galaxy evolution in these environments. Our simulations self-consistently incorporate the effects of ram pressure of the intergalactic medium (IGM) on the disc and halo gas of galaxies and hydrodynamical interaction between disc and halo gas, so that the mass fractions of halo gas stripped by ram pressure of the IGM (Fstrip) can be better estimated. We mainly investigate how Fstrip depends on the total masses of the host environments (Mhost), galactic masses (Mgal), densities and temperature of the IGM (TIGM and ρIGM, respectively), the relative velocities between the IGM and galaxies (Vr) and the physical properties of discs (e.g. gas mass fraction). We find that typically 60–80 per cent of halo gas can be efficiently stripped from Milky-Way-type disc galaxies by ram pressure in clusters with Mhost∼ 1014 M⊙. We also find that Fstrip depends on Mhost such that Fstrip is higher for larger Mhost. Furthermore, it is found that Fstrip can be higher in disc galaxies with smaller Mgal for a given environment. Our simulations demonstrate that the presence of disc gas can suppress ram-pressure stripping of halo gas, owing to hydrodynamical interaction between halo and disc gas. Ram-pressure stripping of halo gas is found to be efficient (i.e. Fstrip > 0.5) even in small and/or compact groups, if ρIGM∼ 105 M⊙ kpc−3 and Vr∼ 400 km s−1. Based on the derived radial distributions of the remaining halo gas after ram-pressure stripping, we propose that the truncation of star formation after halo-gas stripping can occur from the outside in in disc galaxies. We suggest that although the gradual truncation of star formation in disc galaxies can occur in groups, this proceeds less rapidly in comparison with cluster environments. We also suggest that low-mass galaxies are likely to truncate their star formation more rapidly, owing to more efficient halo-gas stripping in groups and clusters.