Rename a Sharepoint Web Application
Must be done in Sharepoint Management Shell (Powershell)
$WebApp = SPWebApplication | where {$_.Name -match "OldWebAppName"}
$WebApp.Name ="NewWebAppName"
$WebApp.Update()
# This bit is just to verify it updated correctly
Get-SPWebApplication | where {$_.Name -match "NewWebAppName"}
Source: https://www.risual.com/2013/04/sharepoint-2013-changing-the-name-of-a-web-application/