How many ports exist?

Ports are stored in 16 bit binary number so it works out as 0 to (2^16) -1 = 65536 -1 = 65535.

What are ports? Combined with the IP address the port represents a unique place to address TCP/IP network data.