Using a stellar mass limited sample of ∼46,600 galaxies (M∗>109.1M⊙) at 0.5<z<2, we show that the tellar mass, rather than the environment, is the main parameter controlling quenching of star formation in galaxies with M∗>1010M⊙ out to z=2. On the other hand, the environmental quenching becomes efficient at z<1 regardless of galaxy mass, and it serves as a main star formation quenching mechanism for lower mass galaxies. Our result is based on deep optical and near-infrared imaging data over 2800 arcmin2, enabling us to negate cosmic variance and identify 46 galaxy cluster candidates with M∼1014M⊙. From M∗∼109.5 to 1010.5M⊙, the fraction of quiescent galaxies increases by a factor of ∼10 over the entire redshift range, but the difference between cluster and field environment is negligible. Rapid evolution in the quiescent fraction is seen from z=2 to z=1.3 for massive galaxies suggesting a build-up of massive quiescent galaxies at z>1.3. For galaxies with M∗<1010M⊙ at z<1.0, the quiescent fraction is found to be as much as a factor of 2 larger in clusters than in field, showing the importance of environmental quenching in low mass galaxies at low redshift. Most high mass galaxies are already quenched at z>1, therefore environmental quenching does not play a significant role for them, although the environmental quenching efficiency is nearly identical between high and low mass galaxies.