William Golding published Lord of the Flies in 1954, and it is clear the story is not set in the future, so 1954 is the starting point in answering this question. As someone mentioned above, the first several chapters of the novel indicate that there is a war going on which involves England, as these are English schoolboys and Ralph's father is a naval commander. That suggests the story is set either during World War I or World War II. The most compelling evidence suggests it is World War II.
First, Piggy mentions a significant detail when he and Ralph are talking in chapter one. He says, "Didn’t you hear what the pilot said? About the atom bomb? They’re all dead.” Whether Piggy thinks everyone is dead or just those in the path of the bomb, he reveals that an atom bomb has been dropped. This clearly sets the story in World War II.
Second, too many references in the story are later than World War I. The boys want to build televisions, for example; televisions were not available early in the century.
Third, this is a tropical island and we know that the battle is nearby because at least two military vessels come by (only one of which stops), and the parachutist in chapter three falls to the island after his plane is shot down in a battle less than ten miles away. None of this is likely to have happened during World War I; in fact all of this points to a World War II time frame.
Finally, Golding was a naval officer during World War II, and we can presume he is writing from some experience here.
The evidence clearly points to the conclusion that Lord of the Flies is set during World War II.
Reread chapters 1 and 2. They allude to a war, but they never say outright that it is WWII. Find your specific quotes there.
Well it's just my teacher keeps on saying that it's in World War two, and as it's a AP class my teacher encourages us to try to prove her wrong or look at possible alternitives.