There are quite a few options in Tokyo for the budget conscious traveller and some of these are seasonally effected (for both price and availability).
The first place most Japanese people I know (as well as personally) check is a site / app called じゃらん. じゃらん shows all hotels with vacancies including low cost business hotels all the way up to places like the Ritz Carlton. They also offer last chance details usually available up to the last check-in time of each individual establishment. Capsule hotels that show up are not representative of all existing establishments (in the sense that a lot of capsule hotels do not advertise through it). Also じゃらん does not give you love hotels as an option (although this can be cheap in a pinch).
A room in a standard hotel off-peak or one that has many vacancies can sometimes be cheap. Average Price ￥4000~￥8000. (NOTE: A standard hotel room)
Japan now has a semi-booming Air B'n'B market where you can sometime snap a place really cheap. It is wise to note that there is somewhat of state of unrest with some normal residents who own adjacent houses because of the noise associated with many people moving in and out of a place. If possible get a hosted place as it usually comes with meals and is usually a house. Average Price ￥1500~￥8000. (NOTE: As domiciles are inherently different, the size of your room / apartments may vary drastically)
These usually offer a cheap room with a bed, TV and Wifi however showers / toilets are usually communal. Average Price ￥2000~￥7000. (NOTE: The room is usually the size of the bed + a small alcove)
Usually have the off-peak rates of a standard hotel but all year round. The rooms are smaller and in some cases the showers are communal. Average Price ￥2000~￥5000. (NOTE: Expect a smaller than standard hotel size room with a Unit Bath / Shower)
These offer a capsule that has a bed, air-conditioning, TV and Wifi however showers / toilets are usually communal. Average Price ￥1500~￥5000. (NOTE: The capsule is usually slightly larger than the size of a person, is separated at the entry by only a curtain and may have a ladder to get to your capsule)
There are many cheap hostels available (especially around Asakusa however they trend to be booked out 2-4 months in advance especially ahead of certain seasons. Most of the time these are shared dorms however there are usually facilities available to hold your valuables. Average Price ￥1000~￥4000 (NOTE: Room size is sometimes large however you will most likely only get a bed surrounded by other people. Showers / bathrooms are often communal).
Japan does actually have an Association of Backpackers and Youth Hostels (Not the official name) and as such there are a few backpacker-specific lodgings around. They are quite hard to find and are usually quite similar to Hostels except there is a chance you may get your own room. Average Price: ￥1000~￥3500 (NOTE: Room size could be either communal or similar in size to a business hotel. Showers / bathrooms are often communal).
Couch surfing is a possibility, however you may struggle to find a place. @fkraiem mentions the site couchsurfing.com however as I have not used it before I am not sure how reliable it may be. Your mileage may vary.
Average Price: FREE~￥2000 (NOTE: As with Air B'n'B, domiciles are inherently different and the size of your room / apartment may vary drastically).
24-Hour Open Public Spaces
There are quite a large amount of 24-hour locations around Tokyo however Train Stations and Bus Stations are not usually included (as most if not all of them close). Both Narita and Haneda Airports are for the most part open 24-hours a day however there are reports of being moved on by overzealous security guards (or even kicked out of the building for a few hours). Some Convenience stores have a café attachment and are open 24 hours a day. Staying without purchasing anything will usually result in being asked politely to leave hence purchasing a small drink / snack is recommended.
Average Price: FREE~￥500 (NOTE: You are sleeping on either an uncomfortable bench, seat or the floor. Showers / bathrooms are either non-existent or require a small fee).
By a newspaper / ask for some cardboard boxes from a supermarket, find a nice corner somewhere that is out of the weather, cover yourself in the boxes / get inside them and go to sleep. Carries a small risk of being assaulted / Robbed / Arrested. Use at your own risk. Strongly not recommended, but included to mention all options.
Average Price: FREE ~ All of your money (NOTE: You are sleeping in / under a cardboard box. There are no showers unless it rains and you are feeling game enough).
This is by no means an exhaustive list and I shall add to it when I find more. Further, the prices listed are inductive of what I have paid previously (in the past 3 years or less) as well as quick online searches in times that I have not experienced a lodging.