What were the reasons for the timing and targets chosen?
As I understand it, the timing of the bombs was dictated mostly by how quickly they could be manufactured, moved out to the Marianas and reassembled. In other words, the idea was to use them as soon as possible so as to get the war over with. The second bomb was used soon after the first because the first did not cause a surrender.
As for the targets, they were picked mainly based on topography. The Americans wanted cities that were somewhat contained within mountains or hills (that surrounded the cities) so that damage would be maximized. If a bomb were dropped on a flat city, the blast would dissipate more and the damage would be less impressive and fearsome. Nagasaki, by the way, was not even the primary target for the second bomb. It got bombed because the primary target was clouded over.
Another thing about the target cities chosen, Hiroshima and Nagasaki, was that since they were militarily less important than other cities like Tokyo or Osaka, they had not yet been bombed as had nearly every other Japanese city. Tokyo had mostly been destroyed by firebombings by this time, and the strategic planners for the military very much wanted to see what the effect of the bomb would be on an undamaged city, so as to gauge its destructive power most accurately, to demonstrate to the world (especially the Soviets) that destructive power, and to show the Japanese that they could no longer resist, and that they should abandon the Code of Bushido and surrender at last.