Have a Google account? your IP and web activity are kept forever
For those with a Google account (you have a Google account if you used Gmail, Picasa etc.) your IP and web activity are kept forever if you did not opt out of Web History. Not to be confused with Google's Search Engine terms and conditions, Web History is an "opt out" feature attached to the set up of a Google account e.g. Gmail such that if you did not opt out you are accepting Google's "Web History" terms and conditions, which are different than their Search Engine terms and conditions.
Web History Terms and Conditions
"What information do you collect when I use Web History?
What happens when I pause the service, remove items, or delete the Web History service?
You can choose to stop storing your web activity in Web History either temporarily or permanently, or remove items, as described in Web History Help. If you remove items, they will be removed from the service and will not be used to improve your search experience. As is common practice in the industry, Google also maintains a separate logs system for auditing purposes and to help us improve the quality of our services for users. For example, we use this information to audit our ads systems, understand which features are most popular to users, improve the quality of our search results, and help us combat vulnerabilities such as denial of service attacks"
The following is an excerpt from Google's Search Engine terms and does not apply to the Web History service:
Search Engine Terms and Conditions
"Why are search engine logs kept before being anonymized?
We strike a reasonable balance between the competing pressures we face, such as the privacy of our users, the security of our systems and the need for innovation. We believe anonymizing IP addresses after 9 months and cookies in our search engine logs after 18 months strikes the right balance."
Note for Chrome, Google Tool Bar etc there are yet more and different sets of terms and conditions, for example with Chrome each installation has a unique application (identification) number, which when combined with other Google services provides a significant amount of data about an individual user.
Tool Bar provides an even deeper analysis of a users online activity. Then there are new products such as Google Voice. Every voice mail, phone number etc. (even if you cancel your account) is permanently logged.