I have been asked about the difference between these two in quite a few interviews. And everytime, I am giving increamental but incompleted answers :p. A summarization:
Mutex(mutural exclusive lock), also called spin-lock, is a busy-waiting synchronization mechanism. Technically, it's supported by the mutex functions in pthread library.
Semaphore is a traditional UNIX synchronization mechanism which defines counted number of resource, and the entities being synchorinized use semaphore by P() and V() operations.
Semaphore and mutex are different in nature. A semphore indicates certain usable resource, and provide a method to use this resource properly. A typical example I could think of using semaphore is the printer queue, which has a upper capacity limit and needs to be carefully managed. On the other hand, mutex is used to implement exclusiveness, resource is mainly protected from being accessed concurrently by more than 1 entity.
Semaphore is very flexible, when the counter is binary, it's very much like a mutex. Do recalled the intrinsic difference: to avoid contention of two writers, we need to use mutex, while to coordinate a writer and a reader, we need to use binary semaphore.
Another interesting use of semaphore is that the resource could be continuous instead of discrete, such as cpu time or memory. Of course, such kind of use is not supported by the Unix library and you will need to make your own.