The movie was very vague about the timeline. I was never under the impression that Cap was frozen exactly right at the end of the war. It felt like mid-1944 to me. Either way, 26-27 when he was frozen.