With the rapid development of heterostructured electrocatalysts, the potential application of transition metal dichalcogenide (TMD)-based composites for electrocatalysis have attracted intense attraction owing to their unique optical, electronic, and mechanical properties. Herein, a facile solvothermal method to obtain heterostructured composites consisting of TMD (WS2) and graphitic carbon nitride (g-C3N4) is reported. DFT calculation results demonstrates that the interface interaction between g-C3N4 and WS2 optimizes the electronic structure of composite materials and activates the active sites. The WS2–g-C3N4 composites with surface sulfur and nitrogen vacancies exhibit high specific capacitance of 1156 F g−1 and excellent cycling stability with no capacitance loss over 2000 charge–discharge cycles, demonstrating huge potential in applications for pseudocapacitive energy storage. In addition, WS2–g-C3N4 composites can attain excellent hydrogen production activity to reach a current density of 10 mA cm−2 at an overpotential of −0.170 V (vs. RHE) and Tafel slope of 59 mV dec−1. This work provides an effective way for the synthesis of heterostructured electrocatalysts with efficient activity for energy conversion and storage.