An ashtray is a receptacle designed for the disposal of cigarette ash and butts. They are typically a small dish intended for use on a tabletop but there are also free-standing and wall-mounted ashtrays. Making an ashtray used to be common arts and crafts type project for school age children, but that was before it became "uncool" to smoke cigarettes and now kids mostly make candy dishes. The most common materials of which ashtrays are made are ceramic, glass, plastic and metal. The metal is usually aluminum due to the ease of working it. Free-standing and wall-mounted ashtrays are typically made of aluminum with some plastic components. It used to be common for department stores to have wall-mounted ashtrays with neat little levers that made them open up (sort of like a reverse impression of pac-man's mouth) and drop the butts and ashes into a storage container for later removal, but you're not really allowed to smoke in any kind of place of business any more so they've all disappeared.
The major design elements of the average ashtray include a bowl or dish shaped receptacle for containing ashes and butts, small crenellations which are used to hold cigarettes, and often a ridged area intended for snuffing lit cigarettes.
Anything that is used for this purpose can be referred to as an ashtray. Besides impromptu ashtrays like empty beer cans and bottles, finished cocktails and hollowed grapefruit rinds, there are a number of unusual devices like pocket ashtrays, smokeless ashtrays, and so on.
Most automobiles have traditionally had both an electric cigarette lighter and an ashtray, but both options are gradually falling by the wayside. Cigarette lighter sockets are still present but instead of coming with a lighter in them they have a plastic cap covering them and are mostly there to plug in your cellphone. The ashtrays are also commonly going away, the earliest example of which immediately comes to mind is the New Volkswagon Beetle, for which you must purchase a "smoking kit" if you want the factory ashtray. In older vehicles, the lighter socket is commonly hidden behind the ashtray door, while in newer ones it is generally more exposed and in a position to be used to supply power to portable devices without interfering with driving the automobile.