Well you should probably avoid port numbers below 1023 but here is the general idea…
Port numbers 0-1023 – Well known ports. These are allocated to server services by the Internet Assigned Numbers Authority (IANA). e.g Web servers normally use port 80 and SMTP servers use port 25 (see diagram above).
Ports 1024-49151- Registered Port -These can be registered for services with the IANA and should be treated as semi-reserved. User written programs should not use these ports.
Ports 49152-65535 – These are used by client programs and you are free to use these in client programs. When a Web browser connects to a web server the browser will allocate itself a port in this range. Also known as ephemeral ports .
Edit: If you are running a web server or the like, you would naturally use the common port… port 80/443 etc. But for most client apps, follow the guidelines above.
I hope this answers the question.