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...)