The nickname can be changed in the profile settings.

You need to click on your profile picture in the main menu:


Then click on the pencil icon to the right of your nickname:


Write the nickname you want in this field and save the changes:


Mind that you can change your nickname no more than once every 3 days. Newly registered accounts can change the name only after 3 days after registration and 100 played games.
If these conditions are not met, there won't be a "pencil" button.