A firewall is configured to permit or deny network connections subject to certain set of rules. All operating systems have firewalls integrated in them, for windows we have the common windows firewall integrated in all windows Operating systems.
A firewall supports features such as, detection of suspicious packets transmitted, detecting the source of such packets, and allowing customization of transmissions that are trusted, hence, ensuring that you have a secured connection to the Internet.
Apart from the operating systems, most anti viruses (especially for Windows) are equipped with a personal firewall, examples include the ZONE ALARM security suite, BITDEFENDER security suite and AVG anti virus. ZONE ALARM also provides a free firewall that can be downloaded separately from the net.
The overall objective of a firewall for your computer is to ensure that you not exposed to hackers while you surf on the net.