Google calculates Quality Score every time a search is performed for one of your keywords. Google says the score can affect your ad auction eligibility, your keyword's cost-per-click, your keyword's first page bid estimate, your keyword's top of page bid estimate and your ad position.
Google's Tanmay Arora posted a big explanation of Google's "Quality Score sauce" in the AdWords Community forum, offering a bit more perspective (hat tip to Barry Schwartz).
"First, the relevance of a keyword is not entirely determined by its presence on the landing page or the number of times it's been mentioned on the landing page," says Arora. "It’s not about how appropriate we find the keyword to the product/landing page but how appropriate the users find it. In other words, the number of users clicking on your ad when they search for that keyword."
"Second, when we add fresh keywords, initially, they’re awarded a historical Quality Score based on their previous performance on Google.com," says Arora. "And only once the keyword starts accruing statistics, the system then evaluates its Quality Score based on its recent performance. This doesn’t happen dynamically but is a gradual process."
Arora talks about one more key ingredient: "We take into account the exact match CTR of the keyword, as it’s a better indicator of the effectiveness of the keyword. (The exact match CTR refers to the number of times the keyword has triggered an ad when the search term exactly matched the keyword.) For example, if our keyword ‘red shoes' is in broad match, it triggers our ad even for search terms like 'red shoe’, ‘formal shoes’, ‘horse shoe,’ etc. However, the exact match statistics point out exactly when the keyword ‘red shoes’ triggered our ad and was clicked on by the user when he searched for the exact search term ‘red shoes’."
There's plenty more to be said...
"Quality Score is an estimate of how relevant your ads, keywords, and landing page are to a person seeing your ad," Google explains in its AdWords help center. "Having a high Quality Score means that our systems think your ad, keyword, and landing page are all relevant and useful to someone looking at your ad. Having a low Quality Score, on the other hand, means that your ads, keywords, and landing page probably aren't as relevant and useful to someone looking at your ad."
"Suppose Sam is looking for a pair of striped socks," Google says. "And let's say you own a website that specializes in socks. Wouldn't it be great if Sam types 'striped socks' into Google search, sees your ad about striped socks, clicks your ad, and then lands on your web page where he buys some spiffy new striped socks? In this example, Sam searches and finds exactly what he's looking for. That's what we consider a great user experience, and that's what can earn you a high Quality Score."
Google says it calculates quality score by looking at your keyword's past clickthrough rate, your display URL's past clickthrough rate, your account history (the overall CTR of all ads and keywords in your account), the quality of your landing page, your keyword/ad relevance, geograhpic performance and your ad's performance on a site.
Google Chief Economist Hal Varian gives a good explanation of quality score in this video from 2 years ago:
In another help center article, Google discusses how to improve your ad quality by creating "very specific" ad groups, choosing your keywords carefully, including keywords in your ad text, creating simple, "enticing" ads, using strong calls-to-action, testing multiple ads, and regularly reviewing campaign performance.