I am aware there is some debate about the extent to which nuclear weapons "ended the war" in Japan. There are many contributing factors to the surrender in August 1945, including the likelihood that the Japanese military was losing, possibly as early as January 1945; the Soviets succeeding in Manchuria and likely to enter Japan, and therefore the preference to surrender to Americans rather than the Soviets; the willingness of the Emperor to refer to the atomic bombs as "new" devastatomg weapons, while surrendering (although "surrender" was not mentioned in the capitulation declaration, etc. The debate about why six days after the Nagasaki bombing, Japan surrendered, is also impacted by the desire of nuclear weapon abolitionists to show that "nuclear weapons aren't needed", and therefore an emphasis on other causes of the surrender. However, given it was unlikely Japan could win the war, given the collapse by Germany, Italy and their allies, is it truthful to say the atom bombs ended the war, or speeded the end of the war? Without those two bombs, what would have been the likely outcomes?
This is a very commonly asked question, and there is an extensive collection of posts related to the atomic bombs and the Japanese decision to accept the Potsdam Proclamation and the end of the war. To give a few highlights:
/u/ScipioAsina discusses the changes in the Japanese political landscape in the days between the dropping of the bomb on Hiroshima and the Japanese surrender here. I also recommend the comments by /u/restricteddata and /u/t-o-k-u-m-e-i later in this same thread.
/u/t-o-k-u-m-e-i discusses the question of whether the onus of deciding the end of the war lies with the atomic bomb or Soviet entry into the war here, with a particular reference to Tsuyoshi Hasegawa's work Racing the Enemy. A now deleted user also delves into the reaction to Hasegawa's work and its wider acceptance by historians here.
The short answer is that it remains a topic of considerable debate. Many of the records of the Japanese government and military were destroyed in the aftermath of the surrender, and personal testimonials must always be considered in the light of how that individual wished to portray themselves. Hasegawa makes a compelling and well researched argument that the Japanese saw the Soviet entry into the war, and the loss of an option to rely on Moscow to mediate a peace as the deciding issue to surrender. However, Edward J Drea, noted historian of the Imperial Japanese Army argues that the threat of the atomic bomb being employed against military forces, thus eliminating the potential for a great decisive battle for the Home Islands was the key tipping point. The discussion is absolutely on going, and there is no single answer.
To speculate on what would have happened without the bombs is kind of futile. There are too many counterfactuals at play, and it's really impossible to give any form of concrete answer.
Aside from the "surrender" statement of the Emperor, that included specific mention of the "new and most cruel bomb", Japan Imperial University historians note that the "majority of leaders entirely lost heart to continue hostilities. Particularly, the debut of the atomic bombs in the Pacific war theatre was decisive." (Emphasis in original). [P124, How Effective is Strategic Bombing? Gian P. Gentile] As Second WW historian Anthony Beevor writes, "It is quite clear that without the atomic bombs [the Emperor] would not have mustered the quiet resolve which he showed later to end the war." [The Second World War, 2012, p774]