The connection between the story and the time period is covered in the e-Notes Study Guide section on "Historical Context," which begins with the following sentences:
During the late 1860s, Harte's tales of the California Gold Rush elevated him to a position of national fame. For the remainder of his career, he utilized the West as the setting for his stories and the inspiration for his lectures on life in the gold mines.
Please use the reference link below to read the full section.
The story begins on November 23, 1850, and John Oakhurst's epitaph in his own handwriting found pinned to a pine tree with his bowie knife states that he committed suicide with a Derringer on December 7, 1850. Since the California Gold Rush started in 1849, the incident occurred only a little over a year after the Gold Rush was bringing hordes of men into the Sierra Nevada Mountains.
In addition to attracting prospectors, the discovery of gold attracted people who preyed on the prospectors. These included prostitutes and gamblers. Bret Harte is flattering Poker Flat by calling it a town. It is just one of the many hamlets that sprang up to offer goods and services to the miners.
Naturally, the public was interested in reading about what was going on in California, since there was so much gold being taken out of the mountains and so many reports circulating about the lawlessness of the region. Bret Harte was obviously an educated and responsible writer, but there were many so-called "dime novelists" who made up fantastic stories about "Wild West" which made it seem more wild than it really was.
Bret Harte happened to be in the right place at the right time. His stories about the West made him famous. His best stories include "The Outcasts of Poker Flat," "The Luck of Roaring Camp," and "Tennessee's Partner," and these have survived because of Harte's writing talent. His biography is included in e-Notes Study Guide for "The Outcasts of Poker Flat."