It is always told as a fact without explaining the reason. Why do two objects get charged by rubbing? Why one object get negative charge and other get positive charge?
The effect in which two objects get charged by rubbing and remain charged is called the triboelectric effect,
where the root "tribo" means friction in Greek (The Greek word $\tau\rho\iota\beta\omega$ means 'to rub'). Friction is actually unnecessary: contact is enough in principle.
This effect shouldn't be confused with the (Volta or Galvani) "contact potential" between metals which only exists as long as the two metals remain in contact, and especially not with "contact electrification" which was a name of a scientifically incorrect theory of electricity at the end of the 18th century that attempted to overgeneralize the interpretation of the triboelectric effect. "Electrophorus" was a gadget, first produced by Volta, that used the triboelectric effect.
The cause of the triboelectric effect is adhesion - the atoms on the surface literally form chemical bonds. Materials such as fur are ready to lose electrons and become positively charged while the materials such as ebonite or glass gain electrons and become negatively neutral. To get some idea about which atoms are likely to lose or gain electrons, it's useful to know their electronegativity:
The redder atom, the higher electronegativity, and the more likely it is for the atom to gain electrons and become negatively charged. That's especially true for light halogens (fluorine, chlorine) and oxygen. That's partly why glass - with lots of $SiO_2$ - likes to get negatively charged in the triboelectric effect. Even sulfur (40% of ebonite) has a higher electronegativity than e.g. carbon and hydrogen that are abundant in the fur which is why fur loses electrons and becomes positively charged.
Of course, the actual arrangement of the atoms in the molecules matters, too. So this overview of the periodic table was just an analogy, not a reliable way to find out the results of the triboelectric effect.
Two small facts to add to Lubos's answer:
protected by Qmechanic♦ Jan 29 '13 at 18:53
Thank you for your interest in this question.
Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).
Would you like to answer one of these unanswered questions instead?