Congestive heart failure (CHF) is a chronic heart condition with heart function decline caused by various heart diseases that requires long-term treatment and affects personal life safety. Presently, CHF diagnosis is being conducted by experts, which is a nonspecific mode that is time consuming and depends on experience. Therefore, it is of great clinical value to conduct CHF recognition through automatic detection. This article proposed an automatic CHF detection model based on a hybrid deep learning algorithm that is composed of a convolutional neural network (CNN) and a recursive neural network (RNN). We also classified normal sinus heart rate signals and CHF signals based on electrocardiography (ECG) and time-frequency spectra during the RR interval. The accuracy of this algorithm was 99.93%, the sensitivity was 99.85%, and the specificity was 100% when 5-min ECG signals were analyzed. It showed a certain improvement over previous studies. We also investigated the detection of CHF patients from healthy subjects by ultrashort-term ECG, and good performance was obtained. The hybrid deep learning algorithm can make objective, accurate classifications of CHF signals and serve as an effective auxiliary tool for the clinical detection of CHF patients.