The plague, along with famine, dying crops and babies being stillborn had been going on for a little while. It never states how many years it had been happening, but it had been going on long enough that they desperately needed help from the gods. The priests of Zeus get together to make an offering to Apollo in the beginning of the play. So the plague has been going on for perhaps a year up to several years. They know that something is wrong because it's gone on long enough, as well as the other problems they're having adding to their demise. It may have begun just after Laius was killed. He and Jocasta had the two girls together, and they are described as "young daughters." So the plague could have been going on for up to 6-7 years approximately.