An overprint is an additional layer of text or graphics added to the face of a postage or revenue stamp, postal stationery, banknote or ticket after it has been printed.   Post offices most often use overprints for internal administrative purposes such as accounting but they are also employed in public mail. Well-recognized varieties include commemorative overprints which are produced for their public appeal and command significant interest in the field of philately. 
The term "surcharge" in philately describes any type of overprint that alters the price of a stamp.  Surcharges raise or lower the face value of existing stamps when prices have changed too quickly to produce an appropriate new issue, or simply to use up surplus stocks.
Any overprint which restates a stamp's face value in a new currency is also described as a surcharge.  Some postal systems have resorted to surcharge overprints when converting to a new national monetary system, such as Sierra Leone did when the British Commonwealth converted to decimal currency in the 1960s. 
Stamps have occasionally been overprinted multiple times. A famous example of repeated surcharging happened during the German hyperinflation of 1921–1923. Prices rose so fast and dramatically that postage stamps which cost five or ten pfennigs in 1920 were overprinted for sale in the values of thousands, millions, and eventually billions of marks. 
Victoria, 1873: Penny stamp overprinted to new value of halfpenny
Guatemala 1881: 1 centavo surcharge on 1/4 real
Ceylon, 1888: Stamp surcharged by a "double inverted" overprint
Overprints have often been used as commemoratives, providing a faster and lower-cost alternative to designing and issuing special stamps or postmarks. The United States, which historically has issued relatively few commemorative overprints, did this in 1928 for issues celebrating Molly Pitcher and the discovery of Hawaii. British stamps heralding the 1966 FIFA World Cup were reissued after England's victory with the overprint "England Winners". Similarly, Guyana issued a set of 32 stamps showing team pictures of all the participants in the 1998 World Cup – after the tournament eight of these were reissued with an overprint announcing France's win.
In some rare cases, commemorative overprints have been applied to souvenir sheets. When these postal commodities are overprinted, they are always very carefully positioned for aesthetic appeal, usually on the blank outer border (" selvage") of the paper.
Hong Kong, 1891: Definitive postage stamp overprinted to commemorate the 50th anniversary of British administration
Soviet Union, 1945: Overprint marking Victory Day
Regular stamps were also overprinted to indicate exclusive usage for a special function or combination of functions; intended for airmail, official mail, newspapers, postage due, special delivery, telegraph and so on. The official stamps of some countries like Great Britain had an overprint which defined the specific official usage; for inland revenue, government parcels, office of works, military, admiralty, war tax (see below). The opposite occurs as well, in this case special function stamps are overprinted to serve as regular stamps.
Malta, 1899: 5s, 1886 issue, overprinted 'Revenue'
Great Britain, 1900: British 1/2d stamp overprinted 'ARMY TELEGRAPHS'
Austria, 1918: Austro-Hungarian Empire stamps overprinted 'FLUGPOST' for airmail. Also surcharged.
Soviet Union, 1924: regular 1918 issue overprinted 'DOPLATA' for postal duty. Also 1 kopeck surcharge.
Great Britain, 1942: British 2d stamp overprinted 'M.E.F.' ('Middle Eastern Forces'), for military use
Soviet Union, 1944: regular 30-kopeck stamp overprinted "AVIAPOCHTA" for airmail, and value increased to 1 ruble
Overprints have been used as security measures to deter misuse and theft.  In the nineteenth century, Mexico was plagued by thefts of stamps on their way to remote post offices. To address this, stamps were shipped from Mexico City to the local districts where they were overprinted with the district name – they were not valid for postage without the overprint.
In El Salvador a significant quantity of stamps was stolen from the San Salvador post office in 1874. As a result all remaining stock was officially overprinted 'Contrasello' preventing usage of the non-overprinted stamps. 
The United States used a similar strategy to deal with thefts in Kansas and Nebraska in 1929, overprinting the current definitive issue with "Kans." and "Nebr." before they were shipped from Washington, to make it more difficult to sell stolen stamps outside the indicated state.
El Salvador, 1874: Contrasello overprint
Great Britain: Victorian stamps of 1891 overprinted for use only on government parcels
United States, 1929: Kansas state overprint
Nations overprinted stamps for use in their colonies mainly for the same reasons as for their domestic use. Due to poor planning, supply problems, faster than anticipated changing postal rates, changes in currency or other reasons they ran out of stamps, and demand had to be met. Some overprints were used to establish the first stage of postal service in a new territorial possession or colony however. If preparations had not been made, the controlling nation's regular homeland stamps would be overprinted with a local name, local currency or 'abroad' indication. In a similar fashion a nation's domestic stamps may be overprinted for use in foreign post offices under that power's control. For example, from 1919 to 1922 the United States overprinted 18 postage stamps at double value and marked for its office in Shanghai, China.
Italy 1874: Overprinted 'ESTERO' (abroad) for use in the Italian post offices abroad
New states or states in transition have sometimes found it necessary to recirculate stocks of stamps printed by a previous government. Some historical perspective may be gleaned from the study of such stamps: some transitional government overprints blend neatly with their predecessors' designs, while others attempt to totally obscure or even deface the older markings. In several European nations in 1944–45, Nazi occupational stamps were overprinted for the provisional governments, and those which depicted Adolf Hitler were most heavily overprinted, obliterating his face.
Latvia, 1993: Soviet stamp overprinted for independent Latvia
During times of war, many nations have issued war tax stamps. Before new stamps could be printed, older stamps were frequently overprinted with surcharges or a simple inscription such as "War Tax".
In actual combat zones, the replenishment of stamp stocks is generally low on a military's list of priorities. In contested or occupied areas, captured local stamps are often expediently overprinted by the occupying forces.
Belgium, World War I: German postage stamp overprinted with "Belgium" for use during the German occupation
Malta, 1918: Postage stamp with wartime taxation applied
Philippines 1942: Japan occupation overprint of US PI stamp for the "First Anniversary of the Great East Asia War", December 8, 1942 (FD/CDS)
Any stamp that is cancelled by postal authorities before it is sold is described as "precancelled":  the precancellation mark is an overprint. This is usually only done when stamps are sold in large bulk quantities to businesses or other large organizations: the postal service will save the labor of cancelling each individual stamp by precancelling the entire purchased quantity.  The overprints also help prevent theft or misuse because they usually include the name of the city or region in which they are to be used. Unlike standard cancellation marks, they usually do not give a specific date, affording the bulk purchaser time to use them at their discretion. In some situations, however, months or years may be included in the overprint to indicate an expiration.
Precancels for official government use are fastidiously prepared, but other kinds are almost always "heavy cancels" which deliberately obliterate much of a stamp's design.
Since the 1980s, many modern postal systems no longer use overprints to indicate bulk purchases. Bulk mail is franked using barcodes on pre-printed envelopes or on blank adhesive labels. The USPS introduced a new standard of barcode cancellation in 2011.
Canada, 1870: Early heavy cancel for bulk purchase
Any overprint that does not originate from a stamp-issuing authority is considered a private overprint or private cancellation. Such overprints almost always invalidate a stamp for postal use. Most countries treat unofficial overprints the same way the United States Post Office does: the USPS Domestic Mail Manual states that stamps "overprinted with an unauthorized design, message or other marking" are not valid for postage. 
Private overprints generally remain outside the formal realm of philately, although individual issues can achieve notoriety through their popularity or aesthetic appeal. Private overprints are typically political messages or commercial promotion, but can also originate from speculative philatelic purposes produced deliberately with a view to selling them to unsuspecting collectors.
Stamps owned by commercial entities have sometimes privately overprinted the backs of their purchased stamps. These overprints are usually made as control marks or accounting information. Such overprinting does not invalidate a stamp unless it shows through the front.
Some stamps are never valid for postal use. They are made for use in promotional displays or as reference material by postal authorities and the Universal Postal Union (UPU). Still others are manufactured by printers for color matching throughout successive printings. In all such cases, the stamps will display the word "specimen" (or "cancelled") on its face. Occasionally, the word may be uniquely handwritten by a postal authority or, much more elaborately, punched through the stamp paper in a method known as perfin. Most often, though, specimen markings are applied as a prominent overprint. 
Colombia, 1888: Overprinted muest(ra) (Sp.)
Natal, 1902: Specimen for a £20 stamp
Australia, 1924: Specimen overprint
The design and printing of valid paper currency is rarely done hastily and overprints are extremely rare, but in times of crisis such measures have been taken. After World War I, the various successor states of the Austro-Hungarian Empire made multilingual overprints to their old Imperial currency until new notes could be designed and circulated.
Currency overprints were also used during World War II to mark all United States dollars in the Hawaiian islands. These Hawaii overprint notes were made in case the islands were captured and the invading forces gained control of the money. 
The Haitian Gourde was overprinted after the unexpectedly rapid fall of the Baby Doc Duvalier regime.  The overprint consisted of a red circle with a slash across it with the date of the end of the Duvalier regime (7 February 1986) printed below in red. The brusque symbol obscured the images of Baby Doc and Papa Doc until they were replaced with images of figures from Haitian history. Something similar was done in Iran in 1979 when the Shah's picture was covered by an intricate design.
Austria, 1919: Austro-Hungarian Imperial krone restricting circulation to the new Republic of Austria
Haiti, 1986: Duvalier portrait obscured with prohibition sign
5 Yen note from 1938 with cancel marks. These were repurposed for military use in China.
5 Yen note (1938) overprinted reverse
Overprint errors are widespread. Known are double, inverted, misspelled, wrong, partly or entirely missing overprints.
Uruguay, 1880–1882: block of four with double overprint 'OFICIAL'
Uruguay, 1891: 5c overprint error, middle stamp with 'Provisorio 1391' instead of 'Provisorio 1891'
Jind, 1886–1899: Half anna Queen Victoria overprinted 'JHIND STATE' inverted
Barbados, 1916: Stamps overprinted for revenue usage with missing tail to y of 'Penny'
Czechoslovakia, 1920: Inverted 28Kc airmail overprint