Since the discovery of graphene, two-dimensional (2D) layered materials have attracted extensive research interest. The synergistic effects of two different 2D semiconductors forming a heterostructure may enhance the intrinsic properties. Here, the photoelectric properties of g-C3N/MX2 (M = Mo, W and X = S, Se) heterostructures and the effect of their interface interaction on photocatalytic activity have been systematically studied. Different stacking structures of g-C3N/MX2 exhibit similar stability and electronic properties. g-C3N/MoS2 is metallic, while the other systems retain semiconductor properties. The interface dipole moment and work function confirm the intrinsic electric field direction from g-C3N to MX2, which reduces the coulomb interaction of carriers and promotes carrier separation. Moreover, the synergistic effect of the band offset and the intrinsic electric field induces the charge transfer to follow a direct Z-scheme in g-C3N/MoSe2, g-C3N/WS2, and g-C3N/WSe2, such that the conduction band (CB) of g-C3N becomes a reduction center and the valence band (VB) of MX2 becomes an oxidation center. Meanwhile, the hydrogen evolution reaction (HER) can occur in either acidic, alkaline, or neutral solutions, and g-C3N/WS2 has the smallest potential-determining step. The oxygen evolution reaction (OER) can occur in solutions at most pH levels, and g-C3N/WSe2 has the smallest potential-determining step. Electrons mainly migrating in the g-C3N layer have higher mobility, which facilitates the HER process. All three g-C3N/MX2 have similar light-absorption strengths, with the absorption edge being red-shifted compared to g-C3N or MX2. Therefore, heterostructure construction does indeed effectively improve the photoelectric performance and photocatalytic activity.