When I start playing a game, I often do so with the intention of enjoying it and relaxing, though a gaming session can quickly last for several hours without the intended relaxation as a result.
I found it good to set a goal beforehand, which gives me the sense of achievement once completed, and reduces the amount of game time.
Examples of good goals:
Goals need to be specific (not “I want to have fun”) and timely (not “I want to finish the entire game”).
A time box is often useful. It can happen that the goal I set for myself is far more involved than I thought.
Goals can be re-evaluated and changed at any time.