For Whom the Bell Tolls takes place sometime in May 1937, in the hills and mountains of north-central Spain near the city of Segovia (not too far north of Madrid). 1937 was the second year of the Spanish Civil War. By this time of the year, Franco's Nationalists (they're the enemies of the people) had showed signs of gaining the upper hand, thanks to numerous military victories and growing air support from Nazi Germany (German planes make several appearances in the novel). Much of the fighting was concentrated in this northern part of Spain. Segovia itself had been taken by the Fascists in 1936, and the action in the book takes place behind Fascist lines. It was not too far from the border with Republican Spain, however, since the Republicans maintained control of Madrid less than 60 miles away.
One thing to know though is that the Republicans did mount a failed attack on Fascist forces near Segovia in May 1937, on May 30/31st; historical analysts of the book suggest that this is the event on which Hemingway based his story. However, an important thing to keep in mind about the book: Hemingway's acknowledged approach in writing the book was to begin grounded in geographic and historical reality, but then invent.
Taking it to a "micro level," the book's action revolves around a steel bridge spanning a gorge on a mountainside within fascist territory. Over the bridge runs a road which is an important fascist supply line; alongside it some ways runs a stream, which intersects with the brook over which the bridge extends. There's a sentry box at either end of the bridge, and a post on either end of the bridge where a small number of troops are stationed: on the eastern side of the bridge which leads higher up the mountain, is a water mill, and on the western side of the bridge which leads down the mountainside, a roadmender's hut.
The Republicans are planning an attack east of the bridge (and up the mountain); the fascist forces would come over the bridge from the west (that bit of information is important for orienting yourself; keeping track of the action, particularly at the end, can be confusing if you don't have a good sense for the geography). The whole area is forested with pine trees, which are a kind of leitmotif in the book (fancy word: it's a recurring symbol, idea, theme, or image with a particular meaning; check out the "Symbols, Imagery, Allegory" section).
Some distance up the mountain from the mill is a well-concealed cave, where Pablo's band of guerillas hangs, and further up still is the hideout of El Sordo. Numerous bands of guerillas apparently live in the surrounding mountains and hills.
One more general point about the setting: the book's setting in Spain is a big deal. Hemingway had very strong feelings about the Spanish people: ultimately, he loved them passionately, but he also found many aspects of them uniquely appalling. The same is true of Robert Jordan, and Hemingway uses the book, especially the thoughts of his protagonist, to give a vivid depiction of Spanish-ness. It's reflected in each of the characters in some way, and the various stories and flashbacks of the book offer Hemingway an opportunity to explore other parts of Spain (Madrid, Valencia, bullbaiting Villaconejos) and weave a richer tapestry.
Hemingway's Spain is a land of hot blood, strong emotions, vitality, exaggerated theatricality, earthiness, and, yes, manliness. It's the Spain of the bullfight, which so fascinated him, though it's also a little more. The only thing which really holds the Spanish spirit together is a certain unbridled intensity which Jordan (and Hemingway) clearly finds intoxicating. That very intensity can lead in quite different directions: intense friendliness and good humor, tremendous profanity, insufferable machismo display, unequalled brutality, and vengefulness. Hemingway depicts a certain unpredictability about the Spanish character, which is a character of extremes. At moments, Hemingway tries to embody that in the landscape itself. Spain is the country where it snows in late May.