  We study the roles of stellar mass and environment in quenching the star
formation activity of a large set of simulated galaxies by taking advantage of
an analytic model coupled to the merger tree extracted from an N-body
simulation. The analytic model has been set to match the evolution of the
global stellar mass function since redshift $z\sim 2.3$ and give reasonable
predictions of the star formation history of galaxies at the same time. We find
that stellar mass and environment play different roles: the star formation
rate/specific star formation rate-$M_*$ relations are independent of the
environment (defined as the halo mass) at any redshift probed, $0<z<1.5$, for
both star forming and quiescent galaxies, while the star formation
rate-$M_{halo}$ relation strongly depends on stellar mass in the same redshift
range, for both star forming and quiescent galaxies. Moreover, the star
formation rate and the specific star formation rate are strongly dependent on
stellar mass even when the distance from the cluster core is used as a proxy
for the environment, rather than the halo mass. We then conclude that stellar
mass is the main driver of galaxy quenching at any redshift probed in this
study, not just at $z>1$ as generally claimed, while the environment has a
minimal role. All the physical processes linked to the environment must act on
very short timescales, such that they do not influence the star formation of
active galaxies, but increase the probability of a given galaxy to become
quiescent.
