The source port is a port that exists only on the computer that is initiating the connection, whereas the destination port exists only on the computer that is receiving it (though both are visible to both endpoints). Both TCP and UDP have both source and destination ports. Usually the source port is selected automatically by the socket library from the unused ports on the computer. There are very few good reasons for selecting a specific source port, and it will often be changed by the Internet gateway (router) as a part of the Network Address Translation (NAT) process.
Edit: To clarify, both the source and destination ports are used for both input and output. Which port is on your computer depends on which end of the TCP connection you are on. If you are on the receiving end, then the destination port is on your computer. When you are looking at the connection from your perspective, it will be the source port, and will be used for both input and output. The same principle applies to UDP as well, except that there are no "connections" per se, merely an exchange of raw data between ports.