if you have citizenship, you get 3 months by default. If not, then I believe the connection time is less than 72 hours. A visa is required for more than that. During the connection time when you are there, you could apply for a visa but it's not guaranteed. That's what I know years ago when I tried to get transit visa over Japan. Also, I was told by japanese embassy in Ottawa that a visitor visa may take several months to be approved becuase for Chinese it has to be done in Tokyo...