World War II started on September 1, 1939 with the invasion of Poland by Germany. Throughout the six years it went on, eight major world powers fought in the war, along with several lesser states joining with one side or the other. On the side which lost was Germany, Japan, and Italy. Against them was the United States, Great Britain and the Commonwealth, Russia, France, and China.
On August 6, 1945, a B-29 Superfortress, the Enola Gay, dropped a nuclear bomb on Hiroshima. Then, on August 9, a B-29 dropped the second atomic bomb. On August 20 the Japanese government told the United States they were ready to accept the terms which the Allies proposed. The next day, the Allies replied, saying the authority of the emperor would be "subject to the Supreme Commander of the Allied Powers." On August 14 the Japanese government agreed to this.
Then, September 2, 1945, the Japanese government, along with all it's military forces, formally surrendered to the United States. This happened in a ceremony aboard an American battleship, the Missouri, on Tokyo Bay, where the Japanese Instrument of Surrender was signed. This was the ending of World War II, after six years almost to the day.