When to prefer hostels: If you're visiting a more popular city (where CS hosts get inundated with requests), if you expect to have little time/energy to interact with a host, if you are travelling with other people, if you need to be able to make plans last-minute, if you're in a place where the typical income is so much lower than yours that couchsurfing is potentially awkward.
When to prefer couchsurfing: If you're visiting a less popular city (where hostels may not exist), if you're not sure what to do in a city such that local suggestions and are helpful, if you're on a long/complicated/impressive trip that hosts will enjoy hearing stories about, if you're in a place where hostels are crazy expensive.