Edited from Wikipedia
The first sleeper cars appeared on American railroads in the 1830s and could be configured for coach seating during the day. Some of the more luxurious types have private rooms.
In the United States today, all regularly-scheduled sleeping car services are operated by Amtrak. Amtrak offers sleeping cars on most of its overnight trains, using modern cars of the private-room type exclusively. In Canada, all regularly scheduled sleeping car services are operated by VIA Rail Canada, using a mixture of relatively-new cars and refurbished mid-century ones; the latter cars include both private rooms and “open section” accommodations.
The Cumberland Valley Railroad pioneered sleeping car service in the spring of 1839, with a car named “Chambersburg,” between Chambersburg and Harrisburg, Pennsylvania. A couple of years later a second car, the “Carlisle,” was introduced into service.
George Pullman, who innovated sleeping cars, started with a luxurious sleeping car (named Pioneer) in 1865. The Pullman Co., founded as the Pullman Palace Car Co. in 1867, owned and operated most sleeping cars in the United States until the middle of the 20th century, attaching them to passenger trains run by the various railroads. Some sleeping cars were operated by Pullman but owned by the railroad running a given train.
During the peak years of American passenger railroading, several all-Pullman trains existed, including the 20th Century Limited on the New York Central Railroad, the Broadway Limited on the Pennsylvania Railroad, the Panama Limited on the Illinois Central Railroad, and the Super Chief on the Atchison, Topeka and Santa Fe Railway.
Today, Amtrak operates two main types of sleeping cars: the bi-level Superliner sleeping cars, built from the late 1970s to the mid 1990s, and the single-level Viewliner sleeping cars, built in the mid 1990s.
In the most common Superliner sleeping car configuration, the upper level is divided into two halves, one half containing “Bedrooms” for one, two or three travelers, each Bedroom containing an enclosed toilet-and-shower facility; and the other half containing “Roomettes” for one or two travelers; plus a beverage area and a toilet. The lower level contains more Roomettes; a Family Bedroom for as many as two adults and two children; and an “Accessible Bedroom” for a wheelchair-using traveler and a companion; plus toilets and a shower.