A microcontroller includes a microprocessor (CPU) as well as a number of other components like RAM, flash and EEPROM to store your programs and constants. While a microprocessor requires external devices to control things like input/output, or timers to implement periodic tasks, and digital to analog converters, a microcontroller is all inclusive. Contrast this all-in-one approach with a typical personal computer which contains an INTEL or AMD CPU, as well as separate chips for RAM, a separate video card, a dedicated hard drive, silicon chips or PCI circuit boards to enable the processor to access USB, serial and video card signals
Microcontroller pins are general purpose, whereas CPU pins are specific. This means that each pin is tied to a multiplexer which you must set to choose the particular use for the pin.
For example, in a microcontroller, one pin pin might be re-purposed for the following tasks
1. The output of a timer
2. Send a signal to a motor
3. Receive an input from a sensor or analog device