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 (F(strip)) can be better estimated. We mainly investigate how F(strip) depends on the total masses of the host environments (M(host)), galactic masses (M(gal)), densities and temperature of the IGM (T(IGM) and rho(IGM), respectively), the relative velocities between the IGM and galaxies (V(r)) 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 M(host) similar to 10(14) M(circle dot). We also find that F(strip) depends on M(host) such that F(strip) is higher for larger M(host). Furthermore, it is found that F(strip) can be higher in disc galaxies with smaller M(gal) 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. F(strip) > 0.5) even in small and/or compact groups, if rho(IGM) similar to 10(5) M(circle dot) kpc(-3) and V(r) similar to 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.