if you're talking about what makes an RPG in videogames, it's a crap shoot. As long as there are stats, some level of customization, and a character for it all to come together on, it's somehow billed as an RPG.
But for the purists out there who do tabletop RPGs, I generally go with the two following criteria:
1. role assumption: the ability to assume the role of a character. This means that just about EVERY game out there can be an RPG in some form, which is clearly wrong. That's why you need the next component.
2. narrative impact: I don't mean like your character has an impact on the plot, but rather you have the ability to change the narrative. Everything else like stats and customization and all that other stuff are just window dressing. Ultimately, it's about being able to control the plot through conflict resolution.
Of course, with this definition, you can almost say that a lot of Japanese eroge might qualify...