As the Git FAQ outlines, user.name has no effect on authentication, and is instead customarily your personal name:
You should put your personal name, generally a form using a given name and family name. For example, the current maintainer of Git uses "Junio C Hamano". This will be the name portion that is stored in every commit you make.
This configuration doesn’t have any effect on authenticating to remote services; for that, see credential.username in git-config(1).
If you're using HTTPS, it's likely that credentials are saved in your credential manager and they're being used without prompting. As the Git FAQ specifies, you can reset them like so:
$ echo url=https://github.com | git credential reject