The situation was a bit more complicated than them being allies then suddenly shifting.
The breakdown between the Allies and the Axis often shown as two united teams fighting for a common goal. For the US, France and Britain, that's mostly true; they were three culturally similar nations teaming up for an united defense. The Axis, conversely, were powers mainly allied through necessity. The Italian and German fascists hated the Soviet communists, and both groups knew a conflict between their two ideologies was inevitable. However, since they were both looking for aggressive expansion, they saw teaming up in the short term before the final fight came as a smart move. Japan was the same way; they didn't have much in common with the other Axis besides the fact they also wanted imperial conquest, but they joined up for the simple fact it makes more sense to ally with other aggressive powers than try to go it alone or try to persuade someone else.
With these alliances in mind, the war kept going until Hitler landed in a spot where he felt he needed to invade Russia or lose the war. He did so, and turned his strongest ally into an enemy with no real chance of being able to effectively occupy them. This is where Churchill came in.
Very similarly to the fascists, the capitalists of Britain and the US distrusted the Russian communist before the war even started. Churchill, though, saw them just as useful and important as Hitler once did. He took advantage of the situation to create an uneasy alliance between Russia, Britain, and the US. I say uneasy because - outside of teaming up with an ideology with the direct goal of destroying their own - there's a couple stories of FDR and Churchill seeing Stalin as a bit off when they interacted with him.
When the war was drawing to a close, the US and Britain landed in a situation like the Nazis and the Soviets were once in; they saw the conflict between ideologies as an inevitability. Moves were made to attempt to limit Soviet influence after the war was over. Churchill drafted "Operation Unthinkable" as a plan to fight Russia immediately following the fall of Germany with help of German regulars and a new bomb he heard the Americans were working on. The plan was too unpopular to go forward with, but it's been argued the same bomb was dropped on Japan partly to prevent the Soviets from being the ones to conquer Japan.