The formation of heterojunction structures can effectively prevent the recombination of photogenerated electron–hole pairs in semiconductors and result in the enhancement of photoelectric properties. Using TiO2 nanotubes (prepared using the hydrothermal-impregnation method) as carriers, CdS-TiO2NTs were fabricated as a photoelectrochemical (PEC) sensor, which can be used under visible light and can exhibit good PEC performance due to the existence of the heterojunction structure. The experimental results show that the prepared CdS-TiO2NTs electrode had a linear response to 2–16 mM glutathione (GSH). The sensor’s sensitivity and detection limit (LOD) were 102.9 µA·mM−1· cm−2 and 27.7 µM, respectively. Moreover, the biosensor had good stability, indicating the potential application of this kind of heterojunction PEC biosensor.