When I was little, I used to put my IRL name! But then, when I started making friends online and wanting to, for example, battle Pokemon with them, I realized I couldn't if I didn't want to expose my real name. I've always been an extremely privacy-conscious person, including from a young age, so from then on, I started using my online alias for my in-game names. I do this for most games now, not just games with online play!
For certain games, though, I use the character's canon name. This is in cases where the main character isn't intended to be as much of a self-insert as they are their own character. For example, in Undertale, Earthbound, and The Legend of Zelda, I use the main character's canon names. But for games like Pokemon, Fields of Mistria and Animal Crossing, I use my online alias.