This study presents a very cost effective template-based electrochemical technique to synthesize the nano heterojunctions of cadmium sulfide (CdS) and cadmium telluride (CdTe). SEM analysis revealed that the average length of CdS nanowires varied from 500 nm to 4 μm depending on the deposition time and voltage. Also, average diameter of the CdS nanowires ranged between 100 and 200 nm. The structures of CdS nanowires have been confirmed by XRD and EDX analysis. Photoelectrochemical performances of CdS nanowires revealed that there is a dramatic change in the photoelectrochemical performances with the change in deposition time and voltage. The maximum fill factor (FF) and power efficiency (η) of the CdS nanowires has been calculated as 45 % and 1.36 %, respectively. After the optimization of the CdS nanowire deposition conditions based on the PEC performance, CdTe nanostructures have been deposited on CdS nanowires at various deposition time. SEM analysis showed that CdTe nanostructures have a tendency to grow as nanoclusters. It was observed that the density and the average diameter of the clusters was a strong function of the deposition time. The average diameter of the CdTe nanoclusters after 9-hour deposition reached about 260 nm. The successful heterojunction of CdS nanowires with CdTe nanoclusters have been observed in the SEM analysis. It has been concluded that the PEC performances of the CdS nanowires improved significantly after CdTe deposition. The maximum η, obtained in this study is about 8.04 %. This is one of the highest efficiencies reported in the literature for the nanowire array photoelectrochemical cells.