You may not realize it, but as you are surfing the web all sorts of details are being left behind about your computer and where you have been. Most of this information is used harmlessly in website statistics, but it could also be used to profile you, or identify you as a vulnerable target for an exploit.
There are a few main pieces of information that get saved when you surf the web, this is by no means a full list, or a list of potentially what someone may be able to get, but the 'average' website will collect this data.
Referring URL - The prior website that you were surfing. This information is quite detailed, it will not just say google.com, it'll give the full website url that referred you, including the search words you used. In fact, they can click or copy that in to their web browser and see the exact page you left. Keep in mind that if you were in a website doing banking or something over a secure connection they won't be able to just login, however some less secure websites encode your password and username in to the URL itself, which could make that possible.
IP Address & Hostname - Your IP address and hostname identify you to the world, without a unique identity you wouldn't be able to request anything from the Internet. This will tell them who your ISP (Internet Service Provider) is and often give away where you live (to the city), or if you are working for a government agency, educational facility, or if you are surfing from behind a company proxy server.
Surfing Habits - Websites will record how many pages you have visited, the amount of time you spent at one page (before clicking on the next), the page you enter on, and the one you exited from.
Operating System and Software - This is a big one, as you are surfing information about your Operating System (OS) and the web browser you are using is recorded. Often the version numbers are also sent out. Additionally, they can actually tell your screen resolution and colour depth!
Most websites as I said before, use all of this information for statistical purposes, targeting advertising, developing a more user or operating system friendly website. However, it is good to keep in mind that a malicious person could also use this information.
Many security features are available through your web browsers, such as different levels of security for trusted and untrusted sites. Some linux browsers allow you to remove operating system and web browser information so it won't be available to websites. Personal firewalls, anti-virus software, malware scanners are all a great thing to have if you do a lot of surfing the web, and of course cleaning your internet cache and history!
It's always a good idea to keep privacy and security in mind when you are surfing the web and be careful of what websites you openly provide information to.