Grumble Grumble Grumble
If your talking about TCP/IP networking ports. a 'port' is only open if there is an application that has 'opened' a network socket, and is waiting, listening for a 'connection' on the 'port'. If there is no application (or service) with the open socket, then the 'port' is closed, and any attempt to connect to it will fail.
The problem you could have is if there is a misconfigured or unpatched and vulnerable service, or an unknown application (such as a worm/trojan) with a socket connection you don't know about that could allow a back door to your system. And this is normally controled by 'Firewall' software. With Windows XP, you could use the 'built in' network firewall and add a network 'port' exception when you want to use your P2P application, and remove the exception when your through, (but this could be a real pain...) A Google search for 'Firewalls' should give you other possible solutions to your problem...
There are also Internet sites that offer services to 'probe' your system to check for the common vulnerabilities (such as the Shields UP site at http://www.grc.com)