I'm assuming you are asking about TCP and/or UDP ports here.
In this case, ports are 16 bit numbers which allow many applications running in your OS to all make use of protocols like TCP and UDP without interferring with each other. One application might use port 2000 to receive data on it, and another 3000. When your TCP/IP stack receives an IP packet destined for a local IP address, if it's TCP or UDP and an application has 'bound' that port number (with that local IP address, or without an IP address) the data in the packet can then be routed to the right application.
When an application makes an outgoing connection, it 'binds' a local port and uses it as the source port for outgoing TCP or UDP packets, and when the other end (the peer) responds, the reply packets come back with a destination port set to the local source port, ensuring that the replies are delivered back to the right application.
There are so called well known ports, such as port 80. Web servers generally listen on port 80, and all commonly used services usually have a well known port so that clients of those services know what port to use as a destination port when sending packets out.
To answer your question about analogies with MAC addresses... A port number is a bit like the address of a local application in your OS, in the same way that your IP is the address of your OS or computer on the internet or the MAC address of your network interface card is the address of your OS or computer on the local network (although it's really specifically the address of that network card to be completely accurate, because a computer can have multiple network cards on different physical networks).
TCP and UDP are really transport layer protocols, so you could say the ports are a communication endpoint in that respect, but they work in conjunction with the IP address (or another protocol if they are encapsulated in something else).