Because tobacco originated from the new world, it only reached China around the end of the XVI th century, most probably introduced by Portugeses tradesmen and Jésuit missionaries.
Due to a different climat and to a high level of humidity in the air, snuff boxes imported from the East no longer fulfiled their initial functions of air/watertightness and were therefore abandoned.
At that time, small bottles ended in an air/watertight stopper were used in China in order to keep and preserve medicinal herbs. The idea occured to use them as snuff bottles.
They usually come in the shape of little bottles 7 to 8 centimetres high and 4 to 5 cm wide. They are equipped with fine curettes in extension of the stopper in order to enable the extraction of the powder.
Box wood skeleton with example of curette
Traditionnally Chinese people carried them tied to their belt in a little silk pouch.
After having been banned, as in numerous other European countries, tobacco was re-introduced in China around 1644 under the Qing dynasty. Snuff taking is rapidly going to be a must at the imperial court but also in the upper social classes before reaching the whole country during the XVIII th century. The emperor Qianlong was himself really keen on snuff taking like as his prime minister Ho Sen, who, as it is said, owed over 3000 snuff boxes !
Emperor Qianlong, Qing dynasty 
Superb snuffboxes in Pekin glass, jade, red coral, china, ivory, amber, lacquer etc... were manufactured during that period.
Ambre / Corail rouge / Ivory
The ones made of metal generally came from Tibet :
Bone and silver coloured metal

Snuff boxes painted from the inside:

Snuff boxes were sculpted, others painted and around 1795, the first snuff boxes painted from the inside appeared: a real technical feat showing the craftman's dexterity, patience and rigour. (see here below an exemple of a pekin glass snuff box painted from the inside. )
A popular story relates its origin:
During the Qing dynasty (1644-1911) an official who was keen on snuff taking decided to stop on his way in a temple in order to have a rest . When he took his crystal snuff bottle, he noticed that it was empty. He scratched some tabacco stuck on the inside of his bottle with a sharp bamboo stem, which left some visible marks. A young monk saw him doing it and got the idea to paint snuff bottles from the inside.
During the manufacturing of such a snuff bottle, the generally smooth inside wouldn't allow the paint to remain on the surface, and the idea occured to insert sand and iron granules. Then the snuff bottle was energetically shaken in order to get a rough surface for the paint.
The accomplished craftman could then create in such a small place all the most popular and traditional Chinese themes: characters, landscapes, flowers, birds, calligraphy and create works of art.
To do so, he used to introduce in the tight neck of the snuff bottle, a small piece of bamboo not bigger than a match but much longer with an end in the shape of a hook.
Soaked in coloured ink and driven into the bottle, the point in the shape of a hook enabled the craftman to create his picture in two main phases: he started by drawing the main details and finished with the background. Exactly the opposite of a normal painting !
Unfortunately it was rapidly noticed that the rough internal part also retained the powder and the use of this type of snuff bottle came to an end. Snuff bottles painted from the inside became afterwards well appreciated as a collector's item but also as a new support for painting.
Other types of snuff bottles kept on being manufactured and used at least until the end of the Qing dynasty in 1911 when their use came to an end with the arrival of the cigarettes.
List of the major dynasties:
Qin Dynasty: 221-207 BC
Han Dynasty: 206 BC-220 AD
Three Kingdoms: 220-280
Period of Disunion: 281-617
Tang Dynasty: 618-907
Five Dynasties: 908-960
Song Dynasty: 960-1279
Yuan Dynasty: 1279-1368
Ming Dynasty: 1368-1644
Qing Dynasty: 1644-1911
Pictures taken at the American Museum of Natural History / New York City:
Snuff bottles