Leísmo
Leísmo ("using le") is a dialectal variation in the Spanish language that occurs largely in Spain. It involves using the indirect object pronouns le and les in place of the (generally standard) direct object pronouns lo, la, los, and las, especially when the direct object refers to a male person or people. Leísmo with animate objects is both common and prescriptively accepted in many dialects spoken in Spain, but uncommon in most others. It thus typically correlates with the use of the preposition a for animate direct objects (for this "personal a", see Spanish prepositions). Leísmo is always rejected in linguistic prescription when the direct object to which it refers is not an animate object. For example:
 ("I see the boy") → Lo veo (standard Spanish, with lo)
 ("I see the boy") → Le veo (leísmo, common in Spain; other regions prefer lo veo)
 ("I see the tree") → Le veo (not accepted in linguistic prescription — the tree is not a person)

Le and les are properly speaking the epicene indirect object pronouns, used for both masculine and feminine antecedents, whether animate or inanimate. In certain dialects the reverse occurs and the indirect object pronouns are replaced by lo, la, los, or las (loísmo and laísmo), but this usage is not accepted by the Real Academia Española (Royal Spanish Academy):

Le voy a dar un regalo (a él/ella) ("I am going to give him/her a present", standard) → Lo voy a dar un regalo
Dile que la quiero ("Tell her I love her", standard) → Dila que la quiero

Theoretical basis
There are various diachronic and synchronic reasons for the use of le/les for direct objects. To understand why there is vacillation and hesitation in usage, it is helpful to understand these often-conflicting linguistic forces. a) Influence of other pronouns and determiners
There is a strong tendency in Spanish, inherited from Latin, for pronouns and determiners to have a set of three different endings for the three genders. These are: -e or -o for masculine pronouns, -a for feminine pronouns and -o for neuter pronouns. Thus, éste, ésta, esto; ése, ésa, eso; aquél, aquélla, aquello; el, la, lo; él, ella, ello. Hence some speakers say le vi ("I saw him") for any masculine person, la vi ("I saw her/it") for any feminine noun, and lo vi ("I saw it") to refer to an inanimate masculine noun (e.g. Vi al piso → Lo vi), or a clause (Viste lo que pasó anoche → Lo viste). This gives us a set like the above: le, la, lo. Furthermore, le also follows the pattern of me ("me") and te ("you") which operate as both direct and indirect objects. Me ven ("They see me")
Te ven ("They see you")
Le ven ("They see him/her" - leísmo)

b) Indirectness for humans — general
There is a tendency, discussed at Spanish prepositions, to treat as indirect objects those direct objects which happen to refer to people. Hence some speakers say le/les vi "I saw him/her/them" when referring to people and lo/la/los/las vi "I saw it/them" when referring to things. This is known as leísmo de persona and is permitted by the Real Academia Española (RAE) only when used in the masculine singular (i.e. le to mean "him"). b1) Indirectness for humans — respect for the interlocutor
The general tendency to use indirect objects for people also occurs when the speaker wishes to convey respect. The second person formal usted is conjugated the same as the third person,  hence some speakers use lo/la/los/las vi "I saw him/her/it/them" when speaking about a third party or an object, but le/les vi "I saw you" when the pronoun is intended to represent usted/ustedes. This is known as leísmo de cortesía and is permitted by the RAE. b2) Indirectness for humans — contrast with inanimate things
The general tendency to use indirect objects for people is intensified when the subject of the sentence is not human, thus creating a contrast in the mind of the speaker between the human and the thing. Hence some speakers say la halagó "he flattered her" when the subject is "he" referring to a person, but le halagó "it flattered her" when the subject is "it", a thing. b3) Indirectness for humans — humanity otherwise emphasised
The general tendency to use indirect objects for people is intensified when the humanity of the person who is the object of the sentence is emphasised by the way the verb is used. Hence some speakers opt for a subtle distinction between lo llevamos al hospital "we took/carried him to the hospital" when the patient is unconscious and le llevamos al hospital "we took/led him to the hospital" when the patient is able to walk. b4) Indirectness for humans — with impersonal se
The general tendency to use indirect objects for people is intensified when the impersonal se is used instead of a real subject. This is to avoid the misinterpretation of the se as being an indirect object pronoun. Hence some speakers say se le lee mucho "people read him/her a lot" if "se" means "people" and "le" means "him/her", and reserve se lo/la lee mucho "he/she reads it a lot for him/her" for sentences in which the "se" is not impersonal. Usage in practice
All of the theoretical reasons for using le/les detailed above actually influence the way Spanish speakers use these pronouns, and this has been demonstrated by various surveys and investigations. Not all usage of direct-object le/les is dialectal, however. In some cases, it is universal across the educated Spanish-speaking world. Let us first look at dialectal extremes. There is leísmo (covered under point a above) motivated by the tendency towards masculine e in uneducated Madrid speech. This actually used to be quite standard, and the Real Academia only stopped endorsing it in the 1850s. We therefore find in old texts:

Such speakers would say le afirman in reference to a word like el hecho, la afirman in reference to a word like la verdad, and lo afirman only in reference to a general neuter "it". The second extreme leísmo is the one motivated by the second point mentioned: the tendency to use indirect objects for people. This is noticeable in Northwestern Spain, especially Navarre and the Basque Country, where regional speech uses le vi for "I saw him/her" and lo/la vi for "I saw it". The same phenomenon is sporadically heard elsewhere, e.g. in Valencia and Paraguay. Now let us look at less extremely dialectal cases. For the majority of educated speakers in Spain and parts of Latin America, neither of the two tendencies (a or b) is enough on its own to justify the use of le/les; but together they are. Thus, speakers who would reject sentences like le vi for "I saw it" and le vi for "I saw her" would nevertheless accept and use le vi for "I saw him". Indeed, this use of le to mean "him" is so common in an area of central Spain that some would call the use of lo vi to mean "I saw him" an example of loísmo/laísmo, i.e. the dialectalism whereby lo is overused. The Real Academia's current line is that le for "him" is officially "tolerated". A case on which the Academy is silent is the tendency described in point b1. It is perfectly common in educated speech in many parts of the world to distinguish between no quería molestarlo "I did not mean to bother him" and no quería molestarle "I did not mean to bother you". Those Spaniards who would not just say le anyway for the reasons explained in the last paragraph are likely to use le in this case. Butt & Benjamin (1994) says that their Argentine informants made this distinction, whereas their loísta Colombian informants preferred molestarlo always. The Academy is also silent on the tendency described in b2; however, it is universal across the Spanish-speaking world. In a questionnaire given to 28 Spaniards in the Madrid region, 90% preferred la halagó for "he flattered her" and 87% preferred le halagó for "it flattered her". García (1975) reports a similar but less extreme tendency in Buenos Aires: only 14% of García's sample said él le convenció for "he convinced him" (the rest said él lo convenció). With an inanimate subject, a slight majority (54%) said este color no le convence. García reports Buenos Aires natives differentiating between lo llevaron al hospital and le llevaron al hospital depending on how active the patient is, although anecdotal evidence suggests that Argentines are more loísta than this, and would prefer lo in both cases. Point b3 is also backed up by the fact that many Latin Americans distinguish between le quiero "I love him" and lo quiero "I want him" (or indeed "I want it"). See also
 Loísmo
 Spanish object pronouns

References

External links 
Leísmo in the Diccionario panhispánico de dudas of the Real Academia Española (in Spanish)

Spanish grammar