Finding accomodation is usually easy if you don't mind spending a lot of money. But most hitchhikers don't have a lot of money, so then there are several other options:
You can bring your tent and sleeping bag and you'll basically be free to sleep anywhere. Beware that in most countries it's not legal to put up your tent anywhere. It is generally legal in Scandinavia, Finland, Scotland and Ireland, though. Legal or not, camping wild needs not to disturb other people. Putting up your tent in a discrete place at or after dusk, breaking up before people will notice and not letting garbage or fire places behind there are general recommendations to stay overnight in situations where camping wild is not officially allowed.
Alternatively, go to a house with a garden and ask if you can camp there.
Quite often there are attractive spots for camping wild near motorway petrol stations. If the noise is disturbing you can take ear plugs along. Even in highly urbanised countries like the Netherlands camping wild is still possible; for example if you hitchhike out of Amsterdam in the evening you can go just to service area Haarrijn, situated along the A2 motorway between Amsterdam and Utrecht. The area is vast and putting up a tent at dusk at the other end of the area will not draw attention, while the spot is scenic (and very "Dutch" with fields, cows and water around).
DigiHitch has an article on sleeping near the highway (not necessarily with a tent).
It can happen that your driver offers you a place at his or her house to put up your tent. It can also happen that you get a place offered inside.
That is why it is so important to create good relation with your driver - more open, honest and respectful you are, more likely it will happen.
For example Mirto is getting sometimes even few invitations during one trip. If you refuse and prefer to continue your way, it might be a good idea to note phone number of your kind driver, in case you will get stuck 10 km further.
Hospitality exchange networks
Hospitality exchange networks require a bit more planning, but are very valuable tools for traveling. Sometimes there are meetings and gatherings of tens, or even hundreds of hospitality exchange members. If you go there you'll surely get a place to sleep!
- CouchSurfing (CS), 580000+ members, managed in an oligarchic way, slightly North American-centric but growing rapidly.
- Hospitality Club (HC), 330000+ members, managed in a dictatorial way, slightly Euro-centric because it was started there.
- BeWelcome an open alternative to HC and CS, 4200+ members
- Global Freeloaders doesn't have a fancy website, but it's easy to send out a lot of messages at once, and members contact you directly over email, which makes it a lot faster to use, probably convenient for finding last-minute places. Though the lack of handy profiles and the direct communication over email definitely make this site definitely less secure (don't use it in Lima).
- HospitalityGuide Hosp.Ex Ne>>t - Hospitality Exchange Networks Overview
- Rahhala.net (Rahhala), 1000+ members, managed in a dictatorial way, Arab travlers and travelers for peace...
See also Current hitchhiking events for times and places where you can find free or very cheap accommodation and friendly people.
Depending on where you are, hostels can be very cheap. The best way to find the cheapest hostel in town and to see wether they have any free beds, is probably hostelworld. You can actually book your beds very short time in advance (1 hour works fine) with no extra fee.