I don't think there's one set measure of when a game is "beaten", but the broadest definition is when the credits roll after finishing the final bit of whatever story a game has, or completing all the basic objectives a game has in the case of sandbox games with defined objectives (factorio, satisfactory, etc).
You can play a game enough to understand it without beating it, and depending on the game you can also beat the game without really understanding how it works too well. For example: Voices of the Void is considered beaten on day 50 of story mode due to there being no more story events and the game telling you such, but you can get a feel for the gameplay and the tone of the game far before that. Rougelikes often serve as an opposite example, but Risk of Rain is a good one, you can beat Risk of Rain without understanding fully the game's systems or how to play all the characters well. Hell, there's a character and some upgrades locked behind beating the game.
And then you get to the topic of multiple endings. Again it depends on the game. Some are clearly meant to be played through one after another due to drastic differences between them and shorter play time, while some games having different endings with different content is to aid in giving the player a sense of choice and consequence, and making the story more interesting, like the SMT games or Fallout 1/2/NV, and is not meant to be played through to every ending. On the other hand, some games even expect you to play all the routes in order since it makes up one big story, like the Sonic Adventure games, the Touhou fighting games' story modes, and NIER games.
Speaking of fighting games, those too are an oddity. Most have a story or arcade mode you can beat, sure, but it won't indicate mastery or even a basic understanding of the game depending on the game and how complex the AI is. Yet you'd still have technically "beaten" the game upon completing said story modes or beating arcade/whatever the main mode is. Doesn't make you good at said game or even give you an understanding of it beyond a very basic level in most cases, especially when playing against "normal" AI and not setting it to maximum.