How long latex paint lasts depends on the quality of the paint and how it is stored. You want to store it in a cool, dry place. Under proper conditions it can typically last up to six years if unopened and a good brand.
1 Additional Answer
If kept in an environment with pretty stable temperature and the lid sealed tight latex paint can last up to ten years. You will know it is bad if it is lumpy or stringy, plus the smell will give it away if it has gone bad.