The official dictionary of the Spanish language, defines the term simply as “a tourist who comes from abroad".
In practice it is not used as an insulting term at all, but rather a quite friendly and tender one. Spanish people will call you guiri when 1- you are clearly not of latin\mediterranean origin (specially if you do come from northern Europe). And 2- you seem to be in need of help because your lack of knowledge of any aspect of the Spanish habits.
Guiri: “Hi! do you know how can I get to the Giralda?”
Spanish: “Sure! But please guiri, you can’t walk around Sevilla in summertime at noon without covering your head. You are going to get a sunstroke, dear!
Somewhat pejorative term for a foreigner, usually a tourist, who happens to be in Spain
and stands out as being pretty obviously not a local. The term is usually used to refer to fairer-skinned people from the likes of Great Britain or Germany, but can be extended to any foreigner that is in Spain.
"Going to a restaurant for dinner at 7 o'clock will make people think you're a guiri"
"Do you even care about Spain's people, culture, language or history? No, all you guiris want is to come here to get drunk and sunburnt."