Although this question has already been marked as answered, I wanted to address some of the additional questions asked in the OP.
Are these ports physical objects?
No ports are not physical objects.
A port number is a 16-bit unsigned integer, which means the range of ports available for use is from 1 to 65535 (port number 0 is reserved and can't be used). A process associates its input or output channels via Internet sockets, a type of file descriptor, with a transport protocol, a port number and an IP address. This process is known as binding, and enables sending and receiving data via the network.
Are they something built into part of my computer? Are they even something physical? Or
written in code? Where is this code? The operating system? What truly is a port?
The operating system's networking software has the task of transmitting outgoing data from all application ports onto the network, and forwarding arriving network packets to a process by matching the packet's IP address and port number.
Only one process may bind to a specific IP address and port combination using the same transport protocol. Common application failures, sometimes called port conflicts, occur when multiple programs attempt to bind to the same port numbers on the same IP address using the same protocol.
The above paragraph is key to understanding why ports/protocols are used in networking. If we did not have a way to specify the protocol, which transmits data over an agreed apon port number - you would not be able to do more than 1 thing at a time (check your email and use the web) because your computer would have no way to differentiate between data for your email client and data for the website you are browsing.
How many ports are there?
Port numbers are assigned in various ways, based on three ranges:
Well Known/System Ports (0-1023) -
This range of ports are used by system processes that provide widely used types of network services (HTTP/80, HTTPS/443, Telnet/21, SSH/22)
Registered/User Ports (1024-49151) - The range of port numbers from 1024 to 49151 are the registered ports. They are assigned by IANA for specific service upon application by a requesting entity. (Webmin/10000, HTTP Proxy/8080, Remote Desktop Protocol/3389, etc)
Ephemeral/Dynamic/Private Ports (49152-65535) - The range 49152–65535 contains dynamic or private ports that cannot be registered with IANA. This range is used for custom or temporary purposes and for automatic allocation of ephemeral ports.
Can I increase or decrease the number of ports?
In regard to being able to increase the number of available ports, you cannot assign a port above 65535 due to the math that allows networking to work (binary) - so the answer to this question is no, you cannot increase the total number of available ports above 65535.
What are protocols?
Within computer science, a communications protocol is a system of digital rules for message exchange within or between computers. When messages are exchanged through a computer network, the rules system is called a network protocol. A protocol is basically an agreed upon set of instructions/commands/calls that two networked devices can both communicate over. Think if we didn't have agreed upon protocols and web servers just randomly sent data to web browsers that the browser did not know what to do with? Luckily we have HTTP and which every web browser created has built into the software so it can communicate with any web server that also speaks the same language (HTTP).
I'd imagine they're some sort of code.... Can you create your own protocol? What language do you use to create a protocol?
Yes you can create your own protocols. Protocols are written in a wide variety of languages. I am not a software developer, but I am pretty sure that as long as whatever language you are using has libraries that allow you to write software that can communicate over TCP/IP (there are other protocol suites, but TCP/IP is the most widely used) you can use that language to write a protocol. The programming language 'C' seems to be the most commonly used to write protocols. This is due to the fact that many of the first network protocols were developed on UNIX in the 1970's and C happens to be the language that UNIX itself is written in.
How do you get a specific port to run a specific protocol?
This differs quite a bit between OS's. For example, to change the port number Remote Desktop Protocol runs on in Windows, you need to edit the registry. On Linux, many of the network services can be configured directly from a .conf file for a particular network service.
How do you define or invent a new protocol?
See https://journal.paul.querna.org/articles/2012/02/22/designing-network-protocols/ for a blog post by someone who has recently developed a new networking protocol and what sort of things he had to do along the way.