Look at the packet format for the TCP segment. The port identifiers are unsigned 16-bit integers, meaning that the largest number you can put in there is 216-1 = 65535.
Computers do not have ports. The concept of "ports" to which you're referring is strictly related to the TCP and UDP protocols of the TCP/IP networking stack. From a strictly technical point of view, both TCP and UDP are structured in such a way as to carry several kinds of information (Source port, Destination Port, Sequence Number, Data, etc.). As both "Source port" and "Destination port" are structured (within the TCP and UDP packet) with a 16 bit "field", here are the limits: source ports and destinations ports can assume all the values that can be represented with 16 bits (aka: from 0 to 65535);
See above: source ports and destination ports can assume values ranging from 0 to 65535 'cause they are both represented with a 16 bit value, inside respective packets
In short, both "source port" and "destination port" play a very important role, as they let a single "host" (a single "client", or a single "server") "offer" different services towards network clients, despite having a single IP address. In other words, without "ports", it would be much harder to have a single "server" offering a web-server (on TCP port 80 for plain HTTP; on TCP port 443 for HTTPS), a mail server (on TCP port 25 for inbound-SMTP; on TCP port 110 for POP3 access; on TCP port 143 for IMAP access), a DB server (on TCP/port 3306 for MySQL)) etc.
"Purist" readers may disagree with me about the above over-simplification and... they will be right: actually, IP-addresses and PORTS play a very important role that, in order to be fully understood, requires a proper understanding of the "encapsulation" concept (for sure, the most important concept among the ones presented in this very answer). Unfortunately, this usually require lots of times to be properly "mastered" and... that's why, my above over-simplification :-)
The port is a part of the layer 4 protocol in use - TCP or UDP, for the most part; it's not related to the memory addressing of the actual computers, so don't get confused by the 32 or 64 bit memory addressing of modern operating systems.
The headers of these layer 4 protocols have specifically defined structures, for which exactly 16 bits are used for the source and destination ports. Without compatibility-breaking changes to the layer 4 protocols that the entire internet depends on, the number of ports cannot be changed. Even the newer SCTP has the 16 bit constraint on ports.
Keep in mind that these protocols identify traffic based not just on the receiving port, but also the receiving IP and the sending port and IP; you're limited to 65535 listening TCP ports (but you don't have that many), and you're limited to 65535 connections to a specific service on a specific remote system (lower in practice, see ephemeral ports), so it's uncommon to run into the limit on these protocols unless you have a system creating a whole lot of connections to a specific remote system.