Well, the perfect answer to that question would be, “As many as you can”. That’s because no matter how many UPSC test papers or previous year question papers you solve, it’s never enough.
The reason for that is the UPSC exams are well known for being unpredictable in nature, as far as the kind of questions asked is concerned.  Thus, test papers will prepare you enough to be able to expect any and every variation that the UPSC incorporated in the IAS exam question pool.