We compared cognitive profiles in chronic heart failure patients (HF), heart transplant recipients (HT) and healthy controls (HC) and examined the relationship between cardiorespiratory fitness (V˙O2peak), peak cardiac output (COpeak) and cognitive performance. Stable HT patients (n = 11), HF patients (n = 11) and HC (n = 13) (61.5 ± 8.5 years) were recruited. Four cognitive composite scores targeting different cognitive functions were computed from neuropsychological tests: working memory, processing speed, executive functions and verbal memory. Processing speed and executive function scores were higher, which indicates lower performances in HF and HT compared to HC (p < 0.05). V˙O2peak and first ventilatory threshold (VT1) were lower in HF and HT vs. HC (p < 0.01). COpeak was lower in HF vs. HT and HC (p < 0.01). Processing speed, executive function and verbal memory performances were correlated with V˙O2peak, VT1 and peak cardiac hemodynamics (p < 0.05). Mediation analyses showed that V˙O2peak and VT1 mediated the relationship between group and processing speed and executive function performances in HF and HT. COpeak fully mediated executive function and processing speed performances in HF only. V˙O2peak and COpeak were related to cognitive performance in the entire sample. In addition, V˙O2peak and VT1 fully mediated the relationship between group and executive function and processing speed performances.