When I go google.com and do a search while being logged in to my Gmail account (or Google account). does Google log that search to that specific account or will it only log that search to the browser?
There are two ways Google 'logs' your searches. Google keeps server logs and there's a feature to log your searches in Web History.
Google stores search information like your web request, Internet Protocol address, browser type, browser language, the date and time of your request and one or more cookies that may uniquely identify your browser anytime you visit the site. Some of this information is tied to your Google Account, if signed in.
It's important to note that IP addresses are anonymized after 9 months and cookies in their search engine logs are anonymized after 18 months.
Additional information can be found in Google's privacy FAQ.
Google can save your Web History to your account if you have a Google account.
Visit your Web History settings to turn it on or off.