The nickname can be changed in the profile settings.

You need to press the ”gear” button in the upper right corner of your avatar:

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, the profile won't open and there won't be a "gear" button.