You must graduate from an accredited program to qualify for the PANCE, and you can apply for the exam anytime within 180 days before your program completion date. The soonest you can take the exam is 7 days after your program completion date.
For more information, read Everything You Need to Know for the PANCE Exam and the Top Questions about Qbanks for PA Students, the PANCE, & Rotation Exams.