5 years
This article - and most similar ones state that you just have to be here for 5 years to get permanent residency status. That's true ONLY if you are a "qualified person" which includes having comprehensive private medical insurance (as well as being either self-sufficient, a job or active job seeking)..
As the NHS covers EU nationals who live here very few bother to pay for additional private insurance just to satisfy some potential future need.