To change your name, head to Alliances and tap the pencil icon next to your player name in 'My Profile'. You will then be asked to enter your desired name.

The first name change is free, while following changes cost Gems.