There are really two meanings to "RPG", mostly because of the JRPGs of the 80s and 90s which weren't really RPGs in the western sense. In those games, you "role play" in the sense that you're given strict roles to play (that is, you control the character, but you can only act and react in the ways that character is meant to act and react). Like a character in a play, they can only ever act or perform in one way (though these days there may be a little more variety in that regard).
In western RPGs (basically anything derived directly or from a similar spirit, as D&D), you not only design your character but design how that character acts and reacts. You're given more freedom to play the role you design, rather than the role that was designed for the player. There are still some limitations, obviously, just because devs can't think of everything (and even if they could it's not economical to include, for example, the summoning of a miniature giant space hamster in order to deal with a random locked manhole cover).
Games like Skyrim and Diablo, although they're billed as RPGs, I feel fall better under the label of "adventure" (more accurately action/adventure) game than RPG. Although you have leeway in how you design your character, the game itself follows a very strict path, much like a Metroid or Zelda or Megaman game: you have some leeway to decide how you play (what weapons you use, even though there is a "best" for most situations, whether you build your character), but the script is set. You play a role designed for you, not a role you design.