Games are fun! They are fun to build and fun to play. They can be an exciting conduit to learning new programming languages or new programming techniques. Here are a few of the games I've built over the course learning to program and just for fun that have allowed me to learn interesting new concepts, and have a good time doing it.
Possibly my favorite game I've built to date has been Twisted Towers! I wrote this game as my final project for Harvard's course, CS50, and I'd call it my first program written completely independently. It helped me get a sense of how to transition to object-oriented programming, as opposed to the procedural programming I'd learned up to that point. Twisted Towers is a tower defense style game that I wrote with Python's Pygame library.
Who doesn't enjoy a good board game? Play Connect 4 and test your wit against another human player or against the computer-AI. You can even set up AI-vs-AI matches and watch the red and blue chips fly. This project was mostly for me try to try to build a "good" AI to play Connect 4 against. You can play the game and then read about how I wrote the AI in this accompanying blog post.
Moth Hunt was the first game and one of the first programs I ever wrote. It's written in Scratch, a learner programming language created by MIT. If you have someone interested in programming, I highly recommend pointing them to this language as a first try. It was a fun experience that got me excited to learn more programming with more useful languages.