A project ID cannot be changed after the project is created, so if you are creating a new project, be sure to choose an ID that you'll be comfortable using for the lifetime of the project.
It seems that the Google console menus have changed since @Sphinxxx posted an answer to this question in 2017. (Unless for some reason my Google account is different than others. Please correct me if I'm wrong.)
It is still possible to rename the project, but in order to get to the Settings page, you must first go through the "IAM & admin" menu. Here are the steps I did:
Choose the project name from the menu just to the right of "Google APIs"
Open the navigation menu by clicking on the three bars ("hamburger") just to the left of "Google APIs"
Hover over IAM & admin in order to see that menu
Click on Settings to open the settings page where you can modify the project name
The easiest way to change your project in a few seconds is to:
Click on the three dots on the left of your profile and then on the Project settings. No matter where you are now in the console, this option will be available.