Here's my personal preferred definition:
1. A social activity and passtime played with others on a real or virtual tabletop.
2. One participant is designated the Gamemaster, whose job is to create and sustain an imaginary world in which the game takes place.
3. The others are players who take actions within that world through their characters.
4. The choices the players can make are limited by the imaginary world, not by the game rules.
5. The resolution of the players actions within that world are determined by the game rules or, when the rules are lacking, by the Gamemaster.
6. The outcome of the actions are determined objectively for the characters in the imaginary world, without regard for factors outside the imaginary world.
7. The characters experience the agency of making real choices that affect the characters in the imaginary world, and the world in general.
I know this definition is unpopular, and leaves out things many people consider to be RPGs, but, while there is absolutely nothing wrong with those activities or the people who enjoy them, I personally consider them different kinds of games. It's also an ideal, and not always reached in my own games, let alone others who may or may not want that kind of experience. My thoughts on RPGs are shaped by this definition, and the closer to it I get at my table, the happier I am.
Some versions of D&D are pretty close to this, mostly the older ones.