A lot of it will necessarily depend on context. The way you describe it, however, it is not racist. Dungeons & Dragons fantasy races really are different, with different special abilities. They are nothing like real-world human races.
The game itself both calls out people of different races for actual differences, and differentiates between races and ethnicities, all in the same sentence:
And the people themselves—people of varying size, shape, and color, dressed in a dazzling spectrum of styles and hues—represent many different races, from diminutive halflings and stout dwarves to majestically beautiful elves, mingling among a variety of human ethnicities.
If, in the real world, blue-eyed people could see twice as far as other eye colors, it would not be at all eyeist to call for “the blue-eyed person” in situations requiring seeing across long distances.
If blond people were able to withstand poisons that could kill non-blonds, it would not be hairist to call for “the blond” to deal with situations that might otherwise kill people.
Even among groups that have known each other a long time and know each other’s names, use of group names rather than individual names is a useful signal about what the need is. This is especially true in the typical D&D situation where special race and class abilities make a huge difference to the success of a dangerous mission and often the survival of members of the party. It is not at all occupationist, for example, for a soldier to call for the medic, even if the medic is a known person with a known name.
Members of a D&D party will often call for “the thief” or “the fighters” to similarly signal situational needs. D&D adventuring parties often display a very similar sense of camaraderie as small military units, and for similar reasons.
But even outside of military situations people will commonly address their doctor solely as “doctor” or “doc”, despite knowing their names, when requesting information of a medical nature. Addressing people by what they can do—professor, chef, farmer, officer, even boss—is very common. Children do it when they address mom or dad, and mom and dad do it when they address each other as ma or pa. Children will sometimes even change the way they address their parents once they have children of their own, because what their parents can do has now changed from being parents to being grandparents.
D&D character races, like D&D character classes, are things the character can do. In Dungeons & Dragons games, the same character might be addressed as their class (cleric, thief), their race (elf, human, dwarf), or their name, depending on the abilities each aspect of the character brings to the current situation. There’s good reason for this, as player choice of race “establishes fundamental qualities that exist throughout your character’s adventuring career.”
For example, a halfling could be a good choice for a sneaky rogue, a dwarf makes a tough warrior, and an elf can be a master of arcane magic.
Dwarves “have advantage on saving throws against poison, and you have resistance against poison damage”. Elves “have advantage on saving throws against being charmed, and magic can’t put you to sleep… Elves don’t need to sleep.” And so on through each of the fantasy races. These are real things in the game that make real differences to success and survival and that dwarf individual variation.
There is nothing like this among human races, except in the imagination of racists. It’s uncomfortable to even use such examples as eyeist, hairist, and occupationist. Like using “racism” to describe acknowledging the real differences between members of very different fantasy races, this trivializes the actual racism experienced by humans in the real world where such differences do not exist and acting as if they do is not justified by biology, magic, or the rules of physics.
“Race” as it is used to describe different human ancestry is not the same word as “race” used to describe fantasy elves, dwarves, humans, and so on. These terms are not the same in any realistic or ethical sense. Acting as if they’re equivalent accepts the racist notion that some human races are inferior and some are superior. It would be racist to act as if the differences between human races are equivalent to the differences between a fantasy elf and dwarf.
In the real world it is racist to claim that each of the human “races” are different, and to treat them differently because of that belief. Those racist claims are wrong. In D&D differences do exist, and it would be racist to claim that they don’t. It would be racist to treat people as if they do not have the special differences of a dwarf, or a human, or an elf. Such refusal to face reality could kill the person whose race is being ignored. Imagine ignoring that humans cannot see in the dark, for example, or that the halfling cannot escape just because the doorway is blocked by an enemy. Imagine calling it racist to bring up those differences, differences that affect the survival of the character, within the game.
One of the things that has always interested me and seems never to be explored in games is how having real, definite races of people would affect the racism against the imaginary differences we’ve made up in the real world. It seems as though having truly different fantasy races ought to make it obvious how incredibly superficial and trivial are the differences that justify hatred among human ethnicities. Sadly, it is easy to be disappointed by the resilience of such racism in the real world, and it’s hard to say that it would not remain resilient even in worlds like that of D&D.
As far as how to bring this up with the character who keeps making the joke, my advice would duplicate Thomas Markov’s, but be less-well written. I’d also echo his experience, personally, that reducing the quantity of at-table jokes vastly increases their quality.