If you're really on a budget and have nowhere else to stay you can usually go to any 24hour internet cafe bar and stay there over night, a lot of Japanese people prefer to do this if they have missed their last train back home.
Doing so is cheaper than a hostel or ryokan, with the added bonus of internet, a massive collection of books and magazines to read, PS2's (probably PS3's in most now), and a lot of places offer full shower facilities.
I did this myself when i was in Shibuya, i had traveled back down from Miyagi and i had three days before going down to Kyoto, i couldn't be bothered looking around for a hostel so i just went straight for the first internet cafe i could find with a shower.
My memory is a little fuzzy (this was in 2006), but coming out from Shibuya station via the Hachikō Exit, i walked across the Scramble Crossing towards the 109 building and went down past the left hand side of that, kept walking for a minute or two up that road and found a really good 24 hour internet cafe there.
If you have lot's of luggage on you, and can't be bothered dragging it around, you can always store it in the large lockers available in each station, i did this and only returned to get clean underwear and socks, past that, my backpack carried toothpaste and showergel, and a spare t-shirt if needed.
Hope this helps mate, all the best, ganbatte!