Water pollution has become a serious environmental issue. The textile industries using textile dyes are considered to be one of the most polluting of all industrial sectors. The application of solar-light semiconductor catalysts in wastewater treatment, among which TiO2 can be considered a prospective candidate, is limited by rapid recombination of photogenerated charge carriers. To address these limitations, TiO2 was tailored with graphitic carbon nitride (g-C3N4) to develop a heterostructure of g-C3N4@TiO2. Herein, a simple hydrothermal synthesis of TiO2@g-C3N4 is presented, using titanium isopropoxide (TTIP) and urea as precursors. The morphological and optical properties and the structure of g-C3N4, TiO2, and the prepared heterostructure TiO2@g-C3N4 (with different wt.% up to 32%), were analyzed by various laboratory methods. The photocatalytic activity was studied through the degradation of methylene blue (MB) aqueous solution under UV-A and simulated solar irradiation. The results showed that the amount of g-C3N4 and the irradiation source are the most important influences on the efficiency of MB removal by g-C3N4@TiO2. Photocatalytic degradation of MB was also examined in realistic conditions, such as natural sunlight and different aqueous environments. The synthesized g-C3N4@TiO2 nanocomposite showed superior photocatalytic properties in comparison with pure TiO2 and g-C3N4, and is thus a promising new photocatalyst for real-life implementation. The degradation mechanism was investigated using scavengers for electrons, photogenerated holes, and hydroxyl radicals to find the responsible species for MB degradation.