Your question needs a lot more detail:
- What do you mean by "open a port"? Do you want to do it in a program? Just run a program?
- What is your network configuration? LAN structure, Internet uplink, OSes involved, which router/switch...
- Do you have any firewalls / NAT in place? On your system, elsewhere in the network?
That said, if you have the "typical" home setup (one or more computers hooked up to a combined switch/router with Internet uplink via DSL or cable): Typically the switch/router/modem combo has a built-in firewall. You'll probably need to open a port there. Usually these devices have a web interface for configuration, look into your manuals.