My first trip to Japan was 20 days long.
I like Tokyo a lot and I could spend 20 days in Tokyo wandering around, visiting off the radar neighbourhoods, side streets, shops and sights. But if your want to see places outside the capital, I think you will enjoy more using different bases. You have a high risk of seeing just trains and stations.
So, as others have said, if you don't have a very strong reason to sleep only in Tokyo, I agree on staying in different places.
If you are on the cheap, in Osaka you can find rooms as cheap as in Tokyo (this is more difficult in Kyoto). Osaka as a base means easier and quicker access to must sees as Kyoto, Nara and Hiroshima.
If this can help you, this was, more or less, my final itinerary for my first trip.
- 7 nights in Tokyo; while in Tokyo, day-trips to a) Nikko, b) Minami-Funabashi fair/Lalaport Shopping Centre (personal interest, not really recommended). Last day, I activated a 14-day Japan Rail Pass.
- 2 nights in Takayama; day-trip to a) Shirakawa-go
- 5 nights in Osaka (cheaper accommodation than in Kyoto); 2,5 days in Kyoto / 1,5 day in Osaka / 1 day in Nara)
- 5 nights in Hiroshima. Day-trips to a) Kyoto (1 day, I needed more time there), b) Okayama garden+Kurashiki, c) Miyajima and d) the worst thing I did: 1 day-trip from Hiroshima to Ise shrines (or how to spend a day inside trains and have little time to see the destination: really poor planning)
- 1 night in Tokyo before flying home
In later trips, I took day-trips from Tokyo to Kamakura and Hakone.
Also, in Tokyo, before to go to the "Tokyo Metropolitan Art Museum", I recommend you the Edo-Tokyo Museum near Ryogoku and the National Museum at Ueno