We know for SQL Server default instance, if TCP/IP protocol is used, the default TCP port number is always 1433. However for a named instance, the TCP port number is dynamic but sometimes, we need to know this port number for various reasons. I find the following way is probably the easiest one:
1. Open a query window from SSMS to connect to the instance of interest.
2. Run:
select local_net_address, local_tcp_port
from sys.dm_exec_connections
where session_id = @@spid
and you get the IP address of the server where the instance resides and the tcp port that is used by the instance.