Like others have said, I think a lot of genres over the years have borrowed heavily from "traditional" RPG's, which has not only blurred the genre lines but also rendered previous criteria for what makes an RPG largely useless.
That being said, the one definition for RPG I really disagree with is "Any game where you play a role." Because frankly that is most games, including Super Mario Bros., since you're "playing the role" of Mario (or Luigi.) I saw someone claim that "The Walking Dead" was an RPG because you played the role of Lee (or later Clem) and got to make "choices" in the world, but I would say that is what Adventure games are/were. And if one's counterargument is "Adventure games are also RPG's," then... the term is pointless.
I'm not a fan of genre gate-keeping. However, on the other side of the spectrum, if we broaden the scope of a category or categories to include literally anything that could possibly be construed by someone as... whatever, then it ultimately defeats the purpose of having categories and makes searching for what you want a logistical nightmare.
That said, I don't know what the solution is, other than sticking to very hybridized terms, like Action RPG, Open World RPG, "immersive sim", JRPG, and whatever else people have come up with to differentiate games, not to be exclusionary or anything, but to facilitate sorting, searching, etc.
So to circle back to the original question, "What makes an RPG?" The answer is "It depends." It depends on what sort of RPG you're looking for, what you like, etc. Ideally we would reach some general agreement, but as the genres continue to blend, that becomes harder.
For me personally, an RPG needs to have at least three things:
1. Meaningful choices. (To me if everyone experiences the exact same story no matter what they do, that's not an RPG, it's an adventure. And yes, some adventure games have meaningful choices, too, but I'm just saying, I personally need them in my RPG's, even if it's just pertaining to side quests/NPC's.)
2. Leveling, either in general or skill-wise. (Again, many of these exist in other genres, but this combination is what I look for in most RPG's.) In a pinch this could even just take the form of better weapons and armor, where applicable, but something at least.
3. Some control over my character's state/progress. Much like point 1, if everyone's character is the same at the end of the game no matter what, then I don't feel like any roleplaying happened, really. Whether it's something minor like looks, haircut, outfit, or drastic like whether I'm smart/stupid, strong/weak, good/evil, etc. If there's zero point in asking another player what their [protagonist] was like at the end, then it's just an adventure/strategy/action/other non-RPG. I don't care what "role" I was in during that time, if I had no say in how that role played out.
I'm trying to think of an example of a game I've played/enjoy as an RPG that doesn't have these three things, and so far I'm drawing a blank. So for me at least, the criteria holds up. But I know not everyone wants the same things, so... *shrug*