You would typically use this along with the systems firewall to allow a port through. Guide for firewalld and iptables. If you change it in the firewall and fail to add/edit it in semanage you can potentially get weird behavior like sshd not wanting to start after changing the port.
semanage port -a -t ssh_port_t -p tcp 2222
The above command allows the sshd service to start, using port 2222.