In this work, ZnIn2S4 layers were obtained on fluorine doped tin oxide (FTO) glass and TiO2 nanotubes (TiO2NT) using a hydrothermal process as photoanodes for photoelectrochemical (PEC) water splitting. Then, samples were annealed and the effect of the annealing temperature was investigated. Optimization of the deposition process and annealing of ZnIn2S4 layers made it possible to obtain an FTO-based material generating a photocurrent of 1.2 mA cm−2 at 1.62 V vs. RHE in a neutral medium. In contrast, the highest photocurrent in the neutral electrolyte obtained for the TiO2NT-based photoanode reached 0.5 mA cm−2 at 1.62 V vs. RHE. In addition, the use of a strongly acidic electrolyte allowed the generated photocurrent by the TiO2NT-based photoanode to increase to 3.02 mA cm−2 at 0.31 V vs. RHE. Despite a weaker photoresponse in neutral electrolyte than the optimized FTO-based photoanode, the use of TiO2NT as a substrate allowed for a significant increase in the photoanode's operating time. After 2 h of illumination, the photocurrent response of the TiO2NT-based photoanode was 0.21 mA cm−2, which was 42% of the initial value. In contrast, the FTO-based photoanode after the same time generated a photocurrent of 0.02 mA cm−2 which was only 1% of the initial value. The results indicated that the use of TiO2 nanotubes as a substrate for ZnIn2S4 deposition increases the photoanode's long-term stability in photoelectrochemical water splitting. The proposed charge transfer mechanism suggested that the heterojunction between ZnIn2S4 and TiO2 played an important role in improving the stability of the material by supporting charge separation.