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.
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. 3600+ 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 less secure.
- HospitalityGuide Hosp.Ex Ne>>t - Hospitality Exchange Networks Overview
See also Current hitchhiking events for times and places where you can find free or very cheap acccomodation 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.