Patients with mental disorders (MDs) are at higher subsequent risk of developing cardiovascular diseases (CVDs) than the general population. Early identification of cardiovascular risk in patients with MDs is beneficial for timely intervention and reducing disease burden. Recently, deep learning approaches have been increasingly applied in CVDs risk prediction. However, these methods have three major issues: 1) mostly relying on multiple types of clinical data, 2) not sufficiently mining and utilizing comorbidity patterns hidden in complex correlations among various diseases, and 3) not fully leveraging the time information, including the irregular intervals. To address these issues, we propose a disease comorbidity network-based temporal deep learning framework (DCNeT) to predict the subsequent CVDs risk for patients with MDs based on routinely collected administrative health data. Firstly, to identify the comorbidity patterns of MDs, we construct a disease comorbidity network (DCN) for MDs and apply graph embedding method to generate disease embeddings for each disease in the DCN. Then, a code attention mechanism is proposed to obtain the weight of each disease which is embedded into dense vectors based on the structure of DCN. We present a view attention mechanism to compute the attention weights of different types of features including disease embeddings, basic features, and disease indicators for generating the final representations of patients’ hospitalizations. Furthermore, to fully utilize the information on the irregular time intervals between hospitalizations, a time encoding module is designed, and the time-aware LSTM is adopted to model the irregular time intervals and capture the temporal patterns of patients’ hospitalizations. The experimental results show that DCNeT outperforms the state-of-the-art methods, with the area under the receiver operating characteristic curve of 0.7658, 0.8143, 0.8110, and 0.7839 on four datasets, respectively. The ablation experiments further demonstrate that each module of DCNeT, including the code attention, view attention, and time encoding module, contributes to its superior performance, with average improvements of 1.20 %, 1.65 %, and 1.13 % in accuracy, respectively. Our DCNeT could be utilized as an efficient framework for identifying high-risk groups of CVDs among patients with MDs that may benefit from screening and preventive strategies.