Five days lets you add a day trip to Nikko, Kamakura or Hakone (each 1–2 hours out) without cutting the city short. Tokyo also works well as the start or end of a wider rail trip through Kyoto and Osaka.

Three to four days covers Tokyo’s main areas at a workable pace, time for Asakusa and the old east side, Shibuya and Shinjuku, a museum or two, and a day trip. Any less and you’ll be rushing between neighbourhoods that are spread far apart.
Five days lets you add a day trip to Nikko, Kamakura or Hakone (each 1–2 hours out) without cutting the city short. Tokyo also works well as the start or end of a wider rail trip through Kyoto and Osaka.