Generally speaking, a firewall is a logical barrier designed to prevent unauthorized or unwanted communications between sections of a computer network. A firewall can be hardware or software based, or both.
A personal firewall is software which runs on a single computer to control how applications on that computer communicate with the internet. A personal firewall can be a powerful tool for monitoring and controlling internet use by application or port, and can provide useful alerts against possible malware attacks.
In practice, personal firewalls can have some complications and drawbacks. Occasionally, personal firewalls detect false positives, labeling legitimate network connections as malicious, when in fact they're useful or even necessary for normal system operation.
Another issue occurs when the sheer volume of confirmations the user is forced to make for connection requests essentially conditions them to always accept them, so malicious connections can occasionally slip by, reducing the effectiveness of the firewall.
It's important to realize that having a personal firewall installed on a computer isn't an end-all solution to security; firewalls should be used in conjunction with other security software and practices, like updated anti-virus software, updated anti-malware software, and having the latest patches for your operating system and applications.
Windows XP SP2 and Mac OS X come with built-in firewalls, so it's usually not necessary to purchase a third party firewall. Advanced users might want the control and flexibility of third-party firewalls, but most of these programs would be overkill for the average user.