Ports are used to identify processes running in the applications on a host.
Let's assume we have two applications running on one PC that require TCP/IP communications. Assume one is a web browser and the other is an email client.
The answer is port numbers.
TCP/IP "Well-Known" Ports
“Well-Known" ports are port numbers that have been reserved for common applications, typically server applications. The port numbers assigned to these server applications have to be known by the client’s Transport layer, so they can add the correct destination port number to messages. Clients know that servers will be listening for their requests at these reserved port numbers. This graphic shows some examples of these Well-Known port numbers.
The well known port numbers are assigned by IANA which is the Internet Assigned Numbers Authority. IANA is the same group that manages the DNS Root and IP addresses.