According to the cities you are staying, and the areas you are visiting, you may choose different areas for your accommodation in Japan.
Tokyo is easily accessible by using the JR Yamanote Line, or the dense network of Tokyo Metro.
Probably the best area for staying is Shinjuku Station area, the busiest railways station in the world. From here, you can virtually travel anywhere in central Tokyo.
Take the Yamanote (or Saikyo) Line for Ikebukuro and Shibuya, the Chuo Line for Tokyo or the Ghibli Museum, the Oedo Line for Roppongi or Tokyo Tower, for example.
Another solution could be sleeping in Asakusa or Ueno, especially if you want to focus on Senso-ji Temple, Akihabara, Ueno and the neighbooring “shitamachi” (Tokyo “local” area) and the new Tokyo Sky Tree Solamachi district.
If you are traveling using a Japan Rail Pass, probably staying near JR Kyoto Station best suits you, as you can access easily to the Shinkansen (bullet trains) from Tokyo and beyond.
However, from here to the different areas of Kyoto, you will need to move by subway or bus, because there is no much of touristic to see in the nearby (excluding the Station itself, the West and East Hongan-ji Temples and the To-ji temple)
In the case your itinerary doesn’t include the use of the Japan Rail Pass, Kansai region can be explored by using private railways (not JR lines), such as Keihan Train, Hankyu Train and such, and the convinient Kansai Surutto Pass… In this case, we recommend you to stay near Shijo-Kawaramachi Area. JR Kyoto Station is a few subway stations afar, but you can reach Nara, Osaka and Central Kyoto with less transfers.
You may want to choose to stay one night in Osaka if flying out from Kansai Airport the following morning, if you want to move quickly to nearby places, such as Mount Koya, Hiroshima, Mino Waterfalls etc, and if you want to enjoy the vibrant Osaka Night Life, and you prefer to have an hotel in the middle of the entertainment district of Namba or Shinsaibashi.
If planning different day trips using the Japan Rail Pass, consider Shin-Osaka or Osaka Station (the former, served by the Shinkansen).