Originally it's a german cuss word for an extremly retarded idiot. But it's also used in other countries too. In Germany you also use it for "Opfer" which is victim in English but in English it makes no sense. You say it to either stupid people or those you don't like that much. You also can say "mayer" but "mayerhofer" is used more often.
Oh my god, you're such a mayerhofer.
Oh look, that mayerhofer is coming.
Guy 1: He's so stupid.
Guy 2: Yea, he's a mayerhofer.