The entire story of "An Occurrence at Owl Creek Bridge" takes place on a railroad bridge in Northern Alabama during the American Civil War. Other events happen in the condemned man's (Peyton Farquar) mind, but the all of the actual action takes place on the bridge.
The railroad bridge is situated above Owl Creek (not a river!) with a small military fort located at one end. The tracks disappear into a forest about 100 yards away. The bank of the stream opposite the forest included
... a gentle slope topped with a stockade of vertical tree trunks, loopholed for rifles, with a single embrasure through which protruded the muzzle of a brass cannon commanding the bridge.
A temporary scaffolding was placed upon the tracks in a manner in which the condemned man would fall between the crossties. Farquar noticed mists downriver below the bridge.
Told in a flashback fashion, Chapter II reverts to Farquar's Alabama plantation some 30 miles away where he meets a thirsty soldier while sitting on a "rustic bench" on the edge of his property. Chapter III then flash-forwards to Farquar's imagined escape. After surviving the hanging, he manages to swim downstream and disappear into the forest, in which he travels all night before arriving back at his plantation home.
This story takes place somewhere in the northern part of Alabama as the Civil War is in its last stages. The Civil War lasts from 1861 to 1865 so this is most likely in 1864 or 1865.
We do not really know much more about the setting. All we know is that Owl Creek is a relatively large river (assuming that what happens in Farquhar's imagination is accurate). It is big enough for Peyton Farquhar to fall into and go under water far enough to be invisible to the Union soldiers who are trying to shoot him.
The story takes place in northern Alabama during the Civil War. Union forces are in control and martial law prevails. There are no civil rights, no safeguards for enemies of the Union, and no trials beyond those of a military court. From Section II, we infer that Farquhar, almost literally the only character, was lured or even entrapped into an attempt to blow up Owl Creek Bridge. We assume that he had tried to overcome the guard and then had been arrested, summarily tried, and condemned to death by hanging from the bridge that he had tried to destroy.