Of Mice and Men takes place on a ranch near Soledad, California in the 1930s.
It happens during the Great Depression, a period of economic problems that started in 1929 and ended in the 1940s. The Dust Bowl, a period of severe drought in the Midwest of the United States, also happened during this time. These two events resulted high rates of unemployment. Many people became migrant workers who traveled from their homes to places like California, that were not as severely affected, in hopes of finding work. George and Lennie in the book are migrant workers who have been to several ranches to find work.
It's also important to note that the book takes place during a time in which the U.S. was still racially segregated, which explains why Crooks, the only African American character, is treated poorly by the other men and sleeps in the barn instead of in the bunkhouse with the others. It also explains why Curley's wife is able to easily threaten Crooks with untrue accusations that could result in lynching.