First, you list down the project names from your CLI.
$ gcloud projects list
Now you can select the particular project to rename its name using the below command.
$ gcloud projects update your-old-project-id --name="New project name"
Hope it helps!!
If you need to know more about Google Cloud, We recommend joining GCP Certification course today.