Question: how long do you need to know someone for a reference?
Answer: The reason the standard response is “five to seven” years is that, after about seven years, it's going to become increasingly difficult for most people to remember with any degree of specificity the particulars about your job performance, which is the essence of real reference checking.