What determines the number of presidential electors for a state?

What determines the number of presidential electors for a state?