All the King's Men is set, for the most part, in Louisiana, though it is only ever referred to in the novel as "the state." Willie Stark is largely based off of Huey P. Long, governor and senator of Louisiana in the 1920s and 30s. Willie's life and career closely resemble Long's, and as such, the book, though never explicitly stated, certainly takes place in Louisiana.
The novel depicts several locations across the state. The story begins in Mason City, where Willie is from and where his family home still stands. Mason City is a representation of rural Louisiana, conservative and insular, and Willie's ability to charm its voters is the first demonstration of his political prowess. Much of the story also takes place in Burden's Landing, where Jack grew up. This small, wealthy town is full of high-society stock, including influential political families like the Irwins. In addition, many scenes in the novel take place in Baton Rouge, the capital. Jack regularly visits Willie's office there while he is governor; Louisiana State, where Jack went to graduate school and researched Cass Mastern, is also in Baton Rouge. The various settings in Louisiana do not seem especially far apart, thanks to Sugar-Boy and the black Cadillac; Willie speeds around the state, covering great distances easily, showing his omnipresence and political power over his jurisdiction. The only time the novel leaves the state is when Jack, after learning that Anne began an affair with Willie, drives alone across the country to Long Beach, "the essence of California." But Jack almost immediately turns around and comes back—returning the novel to Louisiana for good.
The temporal setting of the novel is more complicated. The main narrative begins in 1926, during Willie's first "stooge" candidacy for governor. Willie runs again and wins reelection in 1930 and 1934 and is running for Senate when he is shot in 1936. (This largely reflects Long's career: he was elected as governor in 1928 and then as senator in 1932, and was assassinated in 1935.) Jack's narration uses a variety of flashbacks to various points in the past as well. The most extended of these flashbacks is to some point in the 1910s, when Jack was 21 and Anne was 17, describing their young romance. Jack implies that he is writing the story three years after Willie's death, so the most literal setting of the novel, perhaps, is 1939. Jack depicts the political tendencies of this era, showing progressive, charismatic, often corrupt politicians at work, as well as this period's social mores, depicting large wealth inequality, prohibition, and changing social norms.