How To Respond If Someone Is Giving Bad Nicknames
Quranic advice in this regard is the best to follow, just say Salam and part your way: وَعِبَادُ الرَّحْمَنِ الَّذِيْنَ يَمْشُوْنَ عَلَى الْأَرْضِ هَوْنًا وَإِذَا خَاطَبَهُمُ الْجَاهِلُوْنَ قَالُوْا سَلَامًا. [It is He Who is the most-merciful] and the servants of the most-merciful are the ones who walk humbly on earth and when a person overcome with emotions tries to argue with them, they step aside by saying salam to him . (Quran 25:63) (Excerpt from Quranic Exegesis: Javed Ahmed Ghamidi) (Translated by Dr. Shehzad Saleem)
Another great Quranic advice is to repel evil with good.
These are great suggestions. If still the person doesn’t stop, try this. I went through this during my school years. If being nice doesn’t work, then show anger and stern voice to stop the person. If that doesn’t work, as a last resort create a worse nick name for that person and start calling him by that name. The person will certainly stop calling you with the bad name.