As it has been noted several times, Role-Playing Games is a genre which is difficult to define.
Traditionally, this refers to a game's mechanics; specifically that it uses a combat system derived from the Dungeons & Dragons tabletop RPGs. However, this definition is a little too restrictive; the term is role-playing game and not necessarily roll-playing game. It's a bit of a dated definition in my opinion, but still technically a valid one. Another notable aspect of the genre is the tendency for (most of) the games within it to posess a strong and frequently lengthy narrative. This is probably mostly due to the influence of the Final Fantasy series. Both aspects give the genre an air of sophistication around it, which could be why many RPG fans tend to be rather uptight about the state of their genre.
Broader definitions are the concepts of choice, customization, and character progression. All of these allow the player to approach the game in entirely different ways while still being able to complete it. This is a constrast to many other genres where you're limited to a single playstyle (or alternatively, you're required to use all the different playstyles within the game on a single character). However, in recent years we've seen quite a few games which are definitely not RPGs... but still possess these elements (though they are commonly referred to as "RPG elements"). Heck, quite a few non-RPG genres are getting good storylines as well these days; though they are usually shorter than RPGs and very linear.
---
Looks at all of this, the main problem with the definition of RPGs is that it likely shouldn't even be called a genre; the mechanics are applicable to other genres with ease and good storytelling is universal to all forms of entertainment. Everything which defines a role-playing game is actually an omnipresent aspect of gaming in general.
You can call the Final Fantasy series a predominantly linear story-driven adventure which uses D&D-derived mechanics and character progression. Mass Effect is a third-person shooter with several approaches to tackle the game and a good amount of customization & chracter progression, all in a setting with a strong narrative that spans three games and allows for a great deal of choice. The Elder Scrolls series allows you to immerse yourself in a virtual world, and do just about anything you want within it; all the while encouraging you to explore, do the handful of central quests, and advance your character. World of Warcraft allows you to explore a virtual world with a group of allies and defeat all the enemies within it, all the while compelling the player to continually progress their character. All are officially considered RPGs of some variety (though some are contested), but they're so different in terms of how they play (aside from three of the four using D&D-derived mechanics and number-crunching, but even those are done very differently).
In retrospect, "role-playing games" aren't really a genre so much as a nigh-omnipresent set of mechanics and/or elements in all of gaming. Some games use barely any of them, some use a lot (but almost never does it use only RPG elements). It'd be more accurate to call these types of games "story-driven adventures" or "sandboxes" with a high amount of RPG elements.