En gubbe is a Swedish noun most often used to refer to a male person, and it can be affectionate or derogatory depending on the context.
When talking to your friends about your grandfather, for example, you might refer to him as en gubbe; it's an endearing way of saying “old man”. But it can also be used for men and boys of all ages, particularly young children, who be affectionately called a “lille gubbe” (roughly “little fellow”).
However, it can also be an insult, particularly if used about a man you don't know, or in a negative tone. If you really want to insult someone, it can be coupled with adjectives such as “grinig gubbe” (grumpy old man) or “ful gubbe” (literally 'ugly man' but usually used to mean 'dirty old man' or 'letch').
A good example of how the meaning can change is when Swedish-speaking women use it to refer to their husbands. When said in an affectionate context, “min gubbe” is a colloquial way of saying “my husband”, similar to the British “my man” or “my bloke”, and usually no offence would be intended at all. However, it can also be used to criticize men for letting themselves go: one online list titled 'Signs your man has become a 'gubbe'' lists criteria such as wearing old, worn out underwear, allowing nose and ear hair to grow, preferring to stay at home than go out, and growing grumpy.
So think twice about your tone before you call somebody a gubbe – it can come off harsher than intended and is almost never appropriate if you aren't close with the subject. There's also a female equivalent, en gumma, used mostly to describe older women which has the same ambiguity so can be either affectionate or insulting.
Swedish-learners might be wondering if there's any link to the word for strawberry: en jordgubbe. 'Gubbe' is also a Swedish dialect word to refer to a small lump, and 'jord' means 'earth' in the sense of soil, so a strawberry is quite simply “a small lump that grows in the earth”. Most linguists believe that this dialect word was the origin of 'en gubbe' meaning man, probably first used to refer to small children. Over time, it's likely that it started being used more widely to men of all ages, but it helps explain the sometimes negative connotations.
One final form of 'gubbe' to watch out for: in Swedish slang, 'en gubbe' also means 'a gram' of drugs.
Min man har blivit en tråkig gubbe
My husband has become a boring old man
Jag gick till teatern med min gubbe
I went to the theatre with my husband