RPG is a pretty open-ended term these days. A lot of games claim to be RPGs because they have a skill tree or something like that. I don’t think there is a clear cut list of features that make a game an RPG anymore.
For my money, the defining criteria of an RPG is contained within the name itself: the ability to play a role of your choosing/design (as opposed to one determined by the game). That choice might appear in the character creator (e.g., attribute choices); it might appear in the way you build out your character (skills you choose to emphasize), or it could come in the form of choices in how you approach quests. It doesn't need to have all of these options, but it needs to have some of them - enough that two different players could have two very different experiences, depending on what roles they choose (i.e., how they build out their characters).
I mean, it can't be a "role playing" game if you aren't allowed to play different roles within the game. That's where the term came from - table-top RPGs like D&D, where gamers chose and developed very different roles within the game.
If you're just progressing along a linear path, that's not an RPG. If you're just levelling up based on experience, but the game has a preset path for that leveling, that's not an RPG.
That's how it stacks up to me, anyway. I take the "role playing" aspect of an RPG as a central defining feature. The rest (like progression and leveling) is what I'd call "RPG elements," but not core, defining features. You find those features in many games, but it doesn't make them RPGs. If you don't have choice in the role you're playing, you're not playing an RPG. Seems pretty straightforward to me.
In my mind, an RPG has to have experience points you earn and levels for your character or party. You get stronger the higher your level. Skill trees don’t have to be a part of it but learning new abilities as you level up should be part of the mechanics whether you have skill trees or just learn new attacks or spells at certain points. This isn’t doctrine whatsoever though.
Leveling is (imho) an RPG element, but not a core, defining feature of an RPG. Many shooters have leveling and statistical progression - you get stronger by earning XP (although they may call it something different). These shooters aren't RPGs, though, because there is no option to build out your character in your own, unique way. You level up, but you do it along a linear, pre-determined path. You don't have any choice about
how you level up. That isn't an RPG.
Ultimately, the definition doesn't matter that much. RPG nuts get serious about their games, because they spend so much time with them, and they tend toward being a bit on the obsessive side. They can get fussy and purist about the RPG label. But it doesn't really matter. It's not as if "RPG" is an honorific. What matters is whether the game is good or not.