Gratin (French pronunciation: [ɡʁatɛ̃]) is a culinary technique in which an ingredient is topped with a browned crust, often using breadcrumbs, grated cheese, egg or butter. The term may be applied to any dish made using this method. Gratin is usually prepared in a shallow dish of some kind. A gratin is baked or cooked under an overhead grill or broiler to form a golden crust on top and is often served in its baking dish.
A gratin dish is a shallow oven-proof container used to prepare gratins and similar dishes.
The etymology of gratin is from the French language words gratter, meaning "to scrape" or "to grate" (for example, "scrapings" of bread or cheese), and gratiné, from the transitive verb form of the word for crust or skin. The technique predates the current name, which did not appear in English until 1846 (OED, s.v. "gratin").
In addition to the well-known potato dishes such as gratin dauphinois, gratin may be applied to many other bases of meat, fish, vegetables, or pasta.
Many gratinéed dishes are topped with béchamel, mornay or other sauces.
Potatoes gratiné is one of the most common gratins and is known by various names, including "gratin potatoes" and "Gratin de pommes de terre." Slices of boiled potato are put in a buttered fireproof dish, sprinkled with cheese, and browned in the oven or under the grill (broiler). Sliced raw potatoes may also be baked in a liquid or sauce that steams them and forms a golden crust on top.  In the US, the dish is referred to variously as funeral potatoes, potatoes au gratin, scalloped potatoes, or au gratin potatoes. In English Canada, it is called scalloped potatoes or potatoes au gratin. In French-speaking Canada, the dish is referred to as patates au gratin. Australians and New Zealanders refer to it as scalloped potatoes, potato scallops or (erroneously) potato cake. In North America, traditionally au gratin potatoes include cheese, and scalloped potatoes do not, but this classic differentiation has been lost to time. 
To make pommes de terre gratinées, or "potatoes with cheese," according to the recipe of Marcel Boulestin, large floury potatoes are baked in the oven, then halved and the flesh scooped from the skins. The flesh is mashed with butter, cream, grated cheese, and seasoning(s). The mix is then scooped back into the skins, arranged in a baking dish, sprinkled with grated cheese, and browned in the oven or under the grill. This preparation is also called twice-baked potatoes.
Main article: Gratin dauphinois
Gratin dauphinois is a speciality of the Dauphiné region of France. The dish is typically made with thinly sliced and layered potatoes, and cream, cooked in a buttered dish rubbed with garlic. Some recipes add cheese and eggs. It is called potatoes au gratin in American English.
Gratin savoyard is a similar dish found in the adjacent Savoie (Savoy) department. It consists of alternating layers of sliced potatoes, Beaufort cheese, and pieces of butter, with bouillon as the liquid. Cream is not used.
The Neapolitan dish pasta al gratin (also referred to as pasta au gratin in American English) may be made with various kinds of pasta, including penne, rigatoni, fusilli / spirelli, macaroni, or tagliatelle. The pasta is cooked al dente, then covered with béchamel sauce, cheese (typically a mixture including scamorza, mozzarella or parmesan) and breadcrumbs, then baked.  
Sole au gratin is a sole gratin, often covered with mushrooms. Many fish-based gratins use a white gratin sauce and cheese and brown quickly. Cozze gratinate is a mussels-based recipe found in Italy.
Janssons frestelse ("Jansson's Temptation") is a Swedish gratin of potatoes, onions, and preserved fish, somewhat similar to a French dish of potatoes with anchovies.
Gratin Languedocien is made with eggplant and tomato, covered in breadcrumbs and oil, then browned. This dish is similar to the Italian dish known as melanzane alla parmigiana. Other vegetables commonly used in gratin dishes include cauliflower, spinach, and butternut squash.
The confusion lies in the fact that the classic definitions are often ignored. There are countless recipes for scalloped potatoes ... that call for cheese, breadcrumbs, or both, which, according to my classification above, would technically make them potatoes au gratin.