The relevance of the two atomic bombs dropped on Hiroshima and Nagasaki was that it ended World War II, which is the main goal of the any war so yes, it was necessary. The two bombs dropped might convince the Japanese any further resistance was futile, which worked. After the bombings, there were rumors of Japanese ready to surrender the next few day which claimed to make the two bombings "unnecessary". The generally accepted view that the Japanese would fight to the very end put that rumor at a very small percentage. The Japanese also wanted their current emperor to remain on throne and they were afraid that the surrendering terms would cause the Japanese to choose a new Emperor. The atomic bomb lead America to the atomic age, causing it to build many thousands of nuclear bombs.
Having the many nuclear bombs was a great defense, not for shooting, but to generally let countries know that "hey we have more nuclear weapons than you all combined" so that they would think twice, even three times before attacking America. The dropping of the first atomic bomb proved that by ending the war. The second dropping of the bomb was just as important to causing the Japanese to surrender as much as the first. Just two days after Hiroshima, the Soviet Union declared war on Japan. Dropping the second bomb on Nagasaki would make the surrender of Japan inevitable. What would have happened had the A-bomb not been used?
Of course, the war would have continued. US forces; therefore, would have had to invade the home island of Japan. Doing so, would end in many casualties. American forces would not only have to fight Japanese forces, but Japanese civilians as well.
The Japanese civilians may not seem like a lot compared to the U.S. forces, but the Japanese government had been giving the civilians weapons from guns to spears. With the overwhelming number of civilians compared to American Forces, it would prove to be a hard battle which could lead to many casualties. The number of Japanese civilian casualties could have been greater than that of the atomic bomb and it would have taken a longer period. The Chief of Staff predicted that the Japanese would have surrendered on September 1944, but they were still fighting.
So there was no way of knowing if the Japanese were going to surrender or not. Despite other arguments, the Atomic Bomb was a necessity. Without it, the number of men that would have died on both sides far surpasses that of the number that were killed in the droppings of both Atomic Bombs. Let's face it, the goal of waging war is victory with minimum losses on one's own side, and if possible a minimum amount of losses on the enemy's side.
The Atomic Bomb cut losses to a minimum and drew war to an end quickly. It was just necessary.