sudo tmutil addexclusion [path]
where [path] is a file or folder. For example, if I want to exclude my Downloads folder from Time Machine backups, I would run the following:
sudo tmutil addexclusion ~/Downloads
The tmutil addexclusion command has an interesting property: it's sticky. When you do this, the item you exclude remains in the Time Machine exclusion list even if you move it, which is not the case when you exclude items from the Time Machine preference pane. If you use the above command with the -p flag, then it will not be sticky, and will be the same as an exclusion you add from the GUI.
[kirkmc adds: Updated to correct an error in the post. I've removed the comments that pointed out the error. Sorry!]

