In the United States, it is a crazy and complicated process. To simplify it, very roughly:
1) There are two major parties, the Republicans and the Democrats. The Republicans are somewhat to the right of the Democrats. They dominate politics so completely that we speak of having a "two-party system."
2) The general presidential election is a two-step process. It all happens on the same day, but each state has a separate election. It is a representative election by state. Each state has a certain number of electoral votes. Biggest states get more votes. I live in Massachusetts, which gets 11 votes. California gets 55. Wyoming gets 3.
3) Within each state, the election is "winner-take all." In California in 2012, 60% of the voters voted for Obama, so Obama received ALL 55 of California's electoral votes.
4) The candidate with the largest number of electoral votes wins.
In theory, you are voting to send electors from your state to the "electoral college." There are really electors, they really meet, they really vote, and in theory they are individuals who could choose to vote for anyone they wanted to. In practice, they don't, and the actual meeting and voting in the electoral college is purely ceremonial.
There is constant debate on whether the system of electoral votes is a crazy historical relic or whether it is wonderfully wise.