IDs have to be
unique, there can only be one element in the document tree with a certain ID. Classes can be used multiple times throughout the tree and you can apply any amount of classes on one element.
In practice, you'd use IDs for unique things in your layout such as #page-container, #header, #content, #sidebar and #footer whereas classes can be used for things which are used more than once like .post, .comment, .alignright, .smallicon etc. At least, that's how I use them.