The functionality of sensory neurons is defined by the expression of specific sensory receptor genes. During the development of the Drosophila larval eye, photoreceptor neurons (PRs) make a binary choice to express either the blue-sensitive Rhodopsin 5 (Rh5) or the green-sensitive Rhodopsin 6 (Rh6). Later during metamorphosis, ecdysone signaling induces a cell fate and sensory receptor switch: Rh5-PRs are re-programmed to express Rh6 and become the eyelet, a small group of extraretinal PRs involved in circadian entrainment. However, the genetic and molecular mechanisms of how the binary cell fate decisions are made and switched remain poorly understood. We show that interplay of two transcription factors Senseless (Sens) and Hazy control cell fate decisions, terminal differentiation of the larval eye and its transformation into eyelet. During initial differentiation, a pulse of Sens expression in primary precursors regulates their differentiation into Rh5-PRs and repression of an alternative Rh6-cell fate. Later, during the transformation of the larval eye into the adult eyelet, Sens serves as an anti-apoptotic factor in Rh5-PRs, which helps in promoting survival of Rh5-PRs during metamorphosis and is subsequently required for Rh6 expression. Comparably, during PR differentiation Hazy functions in initiation and maintenance of rhodopsin expression. Hazy represses Sens specifically in the Rh6-PRs, allowing them to die during metamorphosis. Our findings show that the same transcription factors regulate diverse aspects of larval and adult PR development at different stages and in a context-dependent manner.