An efficient and eco-friendly heterogeneous photocatalytic system for the switchable divergent perfluoroalkylation of terminal alkynes has been developed by employing mesoporous graphitic carbon nitride (mpg-CN) as a recyclable, nontoxic, and heavy-metal-free photocatalyst. Regulating the reaction solvents allowed libraries of perfluoroalkylated alkynes, alkenes, and alkenyl iodides to be synthesized in good-to-high yields. Furthermore, mpg-CN is applicable for gram-scale photosynthesis and could be readily recovered for successive reuses.