This game mechanic applies to games that are not story driven and can have no ending. This means that the player can play for an infinite amount of time. The game may get harder as they progress but there is no end point where the player receives a credit scene and the game ends.
This mechanic is used in a lot of mobile and flash games, a popular one being Tetris. In this game, the player has to destroy the blocks by using them to create a row. When the player destroys a row they receive points. The game does not end until the player losses at which point they receive a final score. They can then restart the game and repeat the process to try and last longer.
Another good example of this is Minecraft. Even though Minecraft technically has an ending, the game can be played for an infinite amount of hours as it is not driven by a story but by the imagination and creative mind of the player as the purpose is to build structures.
If I were to use this mechanic in my own game It would be an open world adventure. The player will be online or by themselves and have to collect resources in order to gain equipment. They can explore the world and create structures such as cities for them to live in.