He came in after the Germans surrendered, but before the Japanese did. It depends what you mean by "end of the war"
According to Wikipedia -
German forces in Berlin surrendered May 2, 1945
German forces in northern Europe surrendered May 4, 1945
Most remaining German forces surrendered May 7, 1945 at Rheims in France.
VE Day was set as May 8, because it was Truman's birthday - the Soviets celebrated "Victory Day" on May 9.
Some remnants of German Army Group Centre carried on resistance (around Prague) until May 11/12.
Then you've got Asia - the Japanese mainly surrendered on August 14, 1945, which is considered VJ Day, but the Japanese in China didn't surrender until September 9, 1945.
Chamberlain was PM from 28/5/37 to 10/5/40
Churchill was PM from 10/5/40 to 27/7/45
Attlee was PM from 27/7/45 to 26/10/51, when Churchill secured his second term.