Since you are learning Git, know that this has little to do with git but with the text editor configured for use. In vim, you can press i to start entering text and save by pressing esc and :wq and enter, this will commit with the message you typed. In your current state, to just come out without committing, you can do :q instead of the :wq as mentioned above.
Alternatively, you can just do git commit -m '<message>' instead of having git open the editor to type the message.
Note that you can also change the editor and use something you are comfortable with ( like notepad) – How can I set up an editor to work with Git on Windows?