Open and closed ports

When I set up my ports in the port forwarding setting, is communication only allowed through the ports I have set? For security reasons I am wondering if all other ports are open, and if so, is there a way for them to be closed. Or is the only communication allowed through the ports I have set?