In simple words:
By default, all ports are already opened. However, in order to ping, you need a relevant service to listen to the port.
For example, if you want the port 80 to be available to ping, you need to start a web service.
python -m SimpleHTTPServer 80
With a more professional description:
You can't ping ports, as Ping is using ICMP which is an internet layer protocol that doesn't have ports. Ports belong to the transport layer protocols like TCP and UDP.
However, you could use nmap to see whether ports are open or not
nmap -p 80 example.com