Could ankle swelling that gets very painful during exercise be a sign of congestive heart failure?

Yes. Swelling in ankles can many things. Heartfailure is just one. Gout, arthritis , venous insufficiency, hypothyroidism , are just a few others you need a full exam with detailed history along with labs, cxr, ekg and possibly an echo of the heart.