Homelessness is kind of an open secret in Japan. I've written about this before, but while you can find homeless people pretty much anywhere in Tokyo, no one really wants to admit that they're there. Which kind of works in their favor at times.
Being homeless doesn't necessarily mean being stuck in one place. There's a trick to riding the trains for free, which works if no one wants to acknowledge your presence. First, pick a station that has a heavy rush hour traffic, like the west side of Shinjuku JR, and position yourself along a pillar near a ticket gate. It helps if you're kind of in front of the gate so that people have to bunch up and sidle around you to get past you to the gate. Then, wait until two people are back to chest with each other, and as they're about to enter the gate chute, jam yourself in between them. The timing for the gate receiving the two tickets will be tight enough that it won't be able to sense the third person, and since the one behind you is desperate to move through the chute and grab their ticket, you'll be able to coast through and duck into the crowd on the other side.
Once you're past the gates you can ride pretty much anywhere for as long as you like. Or, you can find a nice corner, curl up and go to sleep. Unless you're actually trying to get somewhere specific, just wait 8 hours, and repeat the process to get back out during the homeward bound rush.