What is the difference between the rpc port 8332 and port 8333?
The Bitcoin.org client will try to communicate to other nodes via port 8333 and those communications follow the Bitcoin protocol.   If an explicit connection is given (IP address and port) the port setting can be overridden to use any port.

The bitcoin.org client can be configured to accept JSON-RPC communications, and when that is enabled will, by default, be on port 8332.  Earlier versions of Bitcoin Core permitted this to be secured with SSL communications using the same port or a different port, however that capability has since been removed.