Context. Gas phase Elemental abundances in molecular CloudS (GEMS) is an IRAM 30m large program aimed at determining the elemental abundances of carbon (C), oxygen (O), nitrogen (N), and sulfur (S) in a selected set of prototypical star-forming filaments. In particular, the elemental abundance of S remains uncertain by several orders of magnitude, and its determination is one of the most challenging goals of this program. Aims. This paper aims to constrain the sulfur elemental abundance in Taurus, Perseus, and Orion A based on the GEMS molecular database. The selected regions are prototypes of low-mass, intermediate-mass, and high-mass star-forming regions, respectively, providing useful templates for the study of interstellar chemistry. Methods. We have carried out an extensive chemical modeling of the fractional abundances of CO, HCO + , HCN, HNC, CS, SO, H 2 S, OCS, and HCS + to determine the sulfur depletion toward the 244 positions in the GEMS database. These positions sample visual extinctions from A V ∼ 3 mag to >50 mag, molecular hydrogen densities ranging from a few ×10 3 cm −3 to 3×10 6 cm −3 , and T k ∼ 10−35 K. We investigate the possible relationship between sulfur depletion and the grain charge distribution in different environments. Results. Most of the positions in Taurus and Perseus are best fitted assuming early-time chemistry, t=0.1 Myr, ζ H 2 ∼ (0.5−1)×10 −16 s −1 , and [S/H]∼1.5×10 −6 . On the contrary, most of the positions in Orion are fitted with t=1 Myr and ζ H 2 ∼ 10 −17 s −1 . Moreover, ∼40% of the positions in Orion are best fitted assuming the undepleted sulfur abundance, [S/H]∼1.5×10 −5 . We find a tentative trend of sulfur depletion increasing with density. Conclusions. Our results suggest that sulfur depletion depends on the environment. While the abundances of sulfur-bearing species are consistent with undepleted sulfur in Orion, a depletion factor of ∼20 is required to explain those observed in Taurus and Perseus. We propose that differences in the grain charge distribution might explain these variations. Grains become negatively charged at a visual extinction of A V ∼ 3.5 mag in Taurus and Perseus. At this low visual extinction, the S + abundance is high, X(S + )>10 −6 , and the electrostatic attraction between S + and negatively charged grains could contribute to enhance sulfur depletion. In Orion, the net charge of grains remains approximately zero until higher visual extinctions (A V ∼ 5.5 mag), where the abundance of S + is already low because of the higher densities, thus reducing sulfur accretion. The shocks associated with past and ongoing star formation could also contribute to enhance [S/H].