It is fairly common for Windows Vista to shutdown slowly sometimes, and this can be for a variety of reasons (such as installing updates, crashed applications or driver problems). If this happens more frequently, it indicates that this problem shouldn't be happening and is worth troubleshooting.
Start by loading the event viewer " " from the run box (press WINDOWS KEY + R to start this):
Once event viewer has loaded, browse to Applications and Services > Microsoft > Windows > Diagnostics-Performance > Operational. This may take a few seconds to appear, as lots of data is loading. Once complete, it will display any significant events in the centre panel. You can scroll through events occurring at the time of a slow shutdown to see which applications or services caused a slowness (look for "Shutdown Performance Monitoring" under the "Task Category" tab):
In this example, a service called TrkWks caused a shutdown problem ("This service caused a delay in the system shutdown process"). Once you have determined which services or applications are causing the problem each time, you can then google for more information to diagnose each item individually. Often, patching or updating drivers can improve these issues.