The short answer
Canadian combat in Europe ended in May 1945. Japan’s surrender that August and September ended the war in the Pacific, where Canada’s role was much smaller.
The end of fighting in Europe
By early 1945, Canadian forces were fighting in the Rhineland and then in the Netherlands. The campaign in the Netherlands was one of the last major Canadian operations of the war in Europe.
On 5 May 1945, German forces in the northwest of the Netherlands, northwest Germany and Denmark surrendered at Wageningen, in the Netherlands. Canadian Lieutenant-General Charles Foulkes accepted the surrender.
On 7 May 1945, Germany signed an unconditional surrender at Reims, in France. The surrender took effect on 8 May, which is why 8 May is celebrated as Victory in Europe Day in Canada and other Allied countries. The Soviet Union marked its victory on 9 May, because the Berlin ceremony was held late on 8 May.
Canadian troops did not go home right away. Canadian forces stayed in Germany and the Netherlands on occupation duty, and many units took months to return.
The end of fighting in the Pacific
Canada’s role in the Pacific was much smaller than its role in Europe. Canadian soldiers fought in Hong Kong in December 1941 and were taken prisoner when the colony surrendered on 25 December. Canadian and American forces later landed on Kiska in the Aleutian Islands in August 1943, after the Japanese had already left.
Japan announced its acceptance of the Allied surrender terms on 15 August 1945. That day is often called Victory over Japan Day, or VJ Day. The formal surrender ceremony took place on 2 September 1945 aboard the USS Missouri in Tokyo Bay.
Why the dates differ
People give different answers depending on which step they count. Some say 7 May, when the surrender was signed at Reims. Others say 8 May, when it took effect. Some point to 15 August, when Japan’s acceptance was announced, and others to 2 September, when the formal surrender was signed.
For the reasons behind the German collapse, the article on why did germany surrender in may 1945 covers the military situation in the spring of 1945.
Where this leaves Canada
Canada fought on several fronts before the fighting stopped, from Hong Kong to the Atlantic to the Netherlands. A fuller year-by-year account of those campaigns is in world war 2 canada timeline.