Definition of an ad impression
In the context of online advertising, an impression is a measure of the number of times an ad is displayed, regardless of whether the ad has been clicked on or not.
Each time the ad is displayed, one impression is counted.
Measurement of ad impressions is usually done by an ad delivery system or platform, like Google AdSense (publisher plaform) or Google AdWords (advertiser platform).
Pageviews vs. ad impressions
Pageviews is a similar metric, but there's a big difference: Pageviews is the number of times the page(s) is displayed, and each page could contain several ads. If each page has 3 ads and there has been a total of 30 pageviews, there has been 90 ad impressions (30 ad impressions for each ad placement).
Because of robot traffic (like Googlebot crawling and indexing the web) and possible click fraud, the system in charge of the statistics should only include valid traffic. Different systems may have different approaches for excluding traffic, and this could be one of several reasons why they report different numbers.
Viewable impressions or in-screen impressions
Though the number of impressions is defined as the number of times the ad is displayed, it does not always mean that the ad has been seen by the person visiting the page. A lot of pages online is longer (length from top to bottom of the page) than what the visitor can view on their screen. If there is an ad at the bottom of the page, it is likely that not all visitors will see the ad. Nevertheless, their visit will be increase the number of impressions. So a traditional ad impression is actually "opportunity-to-see", and in some contexts called served impression.
Some systems and platforms has started implementing counting of impressions that are in-screen (as a separate measurement), and the IAB (Interactive Advertising Bureau) is working towards establishing a standard for viewable impressions. Two issues regarding viewable or in-screen impressions are how much of the ad should be in-screen and for how long. The proposed standard is that a minimum of 50 % of the ad should be in-screen for at least one second to be counted.
I also recommended using the CPM calculator to make sure you get your numbers right.