The photoelectrocatalytic properties of TiO2 nanotube ordered films (TiNT) could be enhanced by decorating them with graphitic-C3N4. The g-C3N4/TiNT heterojunctions have been successfully prepared using a facile and direct chemical vapor deposition method. By controlling type and amount of utilized nitrogen precursor, it is possible to tune the properties of the resulting nanocomposites. Under light irradiation the photoelectrocatalytic activity of the fabricated g-C3N4/TiNT heterojunctions is about 4.7 times than that of bare TiNT, due to their better separation capability of photogenerated charges and wider optical absorption. Characterization by XRD, XPS, UV-Vis DRS and chronoamperometry under simulated sunlight, evidence the relations between the method of preparation and the features of the samples, revealing the high potential of these nanocomposites.