In most cases you could simply use TCP for everything and it wouldn't matter much. For faster paced games when lag can be an issue UDP is often a good choice for sending information that does not necessarily need to be in sequence or even need to be guaranteed to arrive at all.
For example, you wouldn't want to send UDP messages like "move forward 5 squares" because if that for some reason got hit out of sequence or never arrived at all, that client will then forever be out of sync. UDP messages should contain enough information to place the object correctly at any given point without the requirement of previous information like, "put the object at position 100, 200".
There are some good APIs out there if you are interested in not re-inventing the wheel. I'm particularly persuaded to JGN (
http://javagamenetworking.dev.java.net) but I'm biased since I wrote it. There are several others around here that have great features as well.
-Matt Hicks