Temporal rhythm (TR) is involved in the pathophysiology and treatment response of major depressive disorder (MDD). However, there have been few systematic studies on the relationship between TR-related genes (TRRGs) and MDD. This study aimed to develop a novel prognostic gene signature based on the TRRGs in MDD. We extracted expression information from the Gene Expression Omnibus (GEO) database and retrieved TRRGs from GeneCards. Expressed genes (TRRDEGs) were identified differentially, and their potential biological functions were analyzed. Subsequently, association analysis and receiver operating characteristic (ROC) curves were adopted for the TRRDEGs. Further, upstream transcription factor (TF)/miRNA and potential drugs targeting MDD were predicted. Finally, the CIBERSORT algorithm was used to estimate the proportions of immune cell subsets. We identified six TRRDEGs that were primarily involved in malaria, cardiac muscle contraction, and the calcium-signaling pathway. Four genes (CHGA, CCDC47, ACKR1, and FKBP11) with an AUC of >0.70 were considered TRRDEGs hub genes for ROC curve analysis. Outcomes showed that there were a higher ratio of T cells, gamma-delta T cells, monocytes, and neutrophils, and lower degrees of CD8+ T cells, and memory resting CD4+ T cells in TRRDEGs. Four new TRRDEG signatures with excellent diagnostic performance and a relationship with the immune microenvironment were identified.