There are many types of computer ports (i.e. usb, serial, NIC port, fiber, etc..), but we will tackle with the ports specific for communication or transfer of data.
There are two types of communication ports: Physical and Logical
Physical Ports are ports on your computer (NIC), switch or router to which a communication media (network cable) interconnects them. They are connected either by utp cable or fiber.
Logical Ports are numbers assigned to the OS and it's application, tied up with an ip address for communication.
In our example below, the User wants to access the web server below by opening his browser and types in http:example.com. The http protocol uses port 80. The client machine then uses random ports when it comes out from the machine. On the receiving end which is the web server, listens on port 80 (http). The requests from the client machine enters the webserver in port 80. When the webserver responds, it will enter the same or different port on the client machine.