Solution 1:

The port number can be edited in the <TeamCity home>/conf/server.xml file, line <Connector port="8111" protocol="HTTP/1.1".

from Installing and Configuring the TeamCity server

Solution 2:

To add to the answer provided by @sfussenegger you will also need to make sure that your build agents can still connect to the TeamCity server instance on the new port, or else your builds won't run.

To do this, you'll need to change the build agent configuration files to reflect the new serverUrl value. You can find this setting in the C:\TeamCity\buildAgent\conf\buildAgent.properties file.