If you know any mexican people then you'll know this is a non-derogatory term used to refer to US citizens. Mostly because the term "American" does not make sense to the rest of the Americans (all those people who live in the continent named "America", wich is every body from Alaska to argentina), and the word "Estadounidense" (UnitedStatean)is too long.

Folklore says it was generated when the US invaded mexico, wearing green uniforms, and the people shouted at them "Green Go Home".

With time it lost all derogatory status and was turned into the most common word to refer to any US citizen.

a gringo is just a north american or anglo-saxon. it is usually a white person but doesnt have to be. it isnt a hateful term but it can be used hatefully. it also represents behaviour and attitudes latinos consider to be "american".

In Mexico proper, "Gringo" can have a derogatory, or casual/ non pejorative meaning depending on the context of which it is delivered. "Gabacho" has more insulting connotations. A commonly held myth within the environs of Mexico itself is that the origin of "Gringo" was an allusion as to the U.S. Army under the commands of generals Taylor/Scott fielding green coloured uniforms, hence the "Green-Go!!!" silliness. (This is utter rubbish, as any serious student of the Mexican-American War knows that it was the colour blue, and remained so till khaki, and later, onward thence to green, replaced it many decades later. A popular song commonly sung by the intrepid American troops, whilst they marched along was, "Green Grow the Rushes," these words being repeated (refrained) throughout the song, "Green grow,..etc," being taken by (the then) contemporary Mexican ear as "gringo." (The most "likely" origin...) In other regions, apart from Mexico itself, it basically refers to any "european looking" individual.

"Mira a los pinche Gringos de mierda! Como es posible se ganan cada batalla, aunque se tienen erjecitos tan pequeno!?!" "Look at those damned shit Gringos! How is it possible they win every battle, when they have armies so small!?!" (Outnumbered 2-3 to one in every major battle of the 1846-1848 war, when facing an actual standing army... Buena Vista, Chepaltepec, etc...)

Contrary to some things that have been posted here, the US did not wear green coats, or green uniforms, during the Mexican American War, so that explanation for the origin of this word is bogus.

But the term is indeed related to American soldiers who invaded Mexico during the Mexican-American war. It actually came from the lines of what was then a song that was very popular with American infantrymen.

See the example.

A popular American song during that time--one sung by many American troops as they marched--contained the repeated refrain:

"Oh, the ash and the oak and the willow tree,
And green grows the grass on the infantry"

Being members of the infantry, the second line was sung with particular fervor. "Green grows" sounded like "gringoes" to the non-English-speaking Mexicans, so they used that term to refer to all of the American soldiers.

While a commonly used slangterm for Americans used by Mexicans, gringo is used throughout Latin America to refer to Americans. It isn't inherently negative, but in some regions - especially Puerto Rico - gringo often is used to refer to white Americans, and many times in a derogatory fashion.

1.-In Monterrey, Mexico, we use the word "gringo" for people who were born in the US.
It has nothing to do with race. It's not derogative.It's a nationality.
If someone says "pinche gringo" the derogative word is "pinche", not "gringo".
We call them gringos because it'd be stupid to call them "americans", since America is a continent, not a country.