"Cracking Enigma shortened the war by X number of years" is a pretty common trope, but I think Patient Zero is probably Harry Hinsley — he worked at Bletchley Park during the war, and later wrote the British government's four-volume official history of wartime espionage, British Intelligence in the Second World War. This is from a lecture he gave at Cambridge in 1993 (emphasis mine):
Now the question remains how much did it shorten the war, leaving aside the contribution made to the campaigns in the Far East on which the necessary work hasn't been done yet. My own conclusion is that it shortened the war by not less that two years and probably by four years — that is the war in the Atlantic, the Mediterranean and Europe.
Hinsley's argument, in the broad strokes, is that Ultra intelligence was decisive in turning the tide of the Mediterranean and North African campaigns in 1941-43; that a more drawn-out campaign in North Africa would have delayed the invasion of France beyond 1944; that Ultra enabled the Allies to win the Battle of the Atlantic, keeping their supply lines open and neutralising the German U-boat fleet at least enough to prevent them from posing a real threat to an invasion of mainland Europe.
The problem, as I see it, is that Hinsley seems to get into the business of 'X happening means that Y would then happen, followed by Z; because A didn't happen, B did and so C followed.' It instinctively feels a bit arbitrary to me, the idea that you can put a precise (or even a vague) number on how much time was saved by the Ultra programme.
I rather like how Richard Aldrich, who has written the definitive history of GC&CS and GCHQ, puts it:
In reality, the debate about the overall value of Bletchley Park has a troubling 'What if?' quality. Inevitably, we are encouraged to ponder the alternative universe of 'no Ultra'.
Counterfactuals generally don't contribute much to historical analysis, and they're almost always impossible to actually substantiate. In that lecture, Hinsley actually refers to the idea of "strict, sensible, proper counter-factual history" — and I'm not sure there even is such a thing.
Was Ultra intelligence incredibly useful to the Allies? Certainly. Could you argue convincingly that it helped them win the war? Sure, within reason. But you have to do some intellectual acrobatics, and arrange your (deeply circumstantial) evidence just so in order to stand up the statement that it shortened the war by two years, or four, or whatever.
I have a follow-up question: Isn't it disingenuous to suggest that the Nazi regime was toppled by codebreaking when the Soviets were clearly going to march into Berlin anyways? Put another way, did the Enigma mostly help on the Western Front and Mediterranean? The Soviets seemed to be doing just fine (relatively speaking) by 1945.
To clarify, did the movie attribute that quote to someone specific?