It really depends on the pollster. Generally, a random sample is taken of the population, using methods such as random telephone number generation, and this sample is then weighted to correct for demographic size and sampling issues.
Gallup publishes information about how it samples the population for its weekly U.S. Poll. In this case, the sampling is done by randomly generating landline and cellphone numbers, and then randomly selecting a person from each household it rang. After results have been collated, the results are weighted, to correct for "unequal selection probability, nonresponse, and double coverage of landline and cellphone users", as well as to ensure that the demographics of the sampled population match the demographics of US population as a whole.
Some pollsters use online sampling instead of phone interviews. YouGov, for instance, uses 'Active Sampling', which uses data held about people signed up to their website to ensure that they have a ready-weighted sample of the population to poll. This then undergoes further weighting after results are collected.
Nate Silver has written previously about this, critiquing several sampling methods used by polling companies. Particularly, he mentions Rasmussen, which only conducts phone calls during certain time frames:
Typically, calls are placed from 5 pm to 9 pm local time during the
week. Saturday calls are made from 11 am to 6 pm local time and Sunday
calls from 1 pm to 9 pm local time.
Source - Rasmussen Reports
He also mentions other flaws:
They do not call phone numbers back, as most other pollsters do, in
the event they don’t get an answer the first time. They don’t call
cellphones — only landlines. And they speak to the first person they
get on the line if they speak to anybody at all; other polling firms
use carefully-designed procedures to randomize the selection of
respondent within the household (a typical mechanism is something like
asking that the adult with the next birthday come to the phone).
So you can see, the method of sampling depends greatly on the pollster, and therefore it is important to check the methodology of specific polls in order to contextualise their findings.