Check with the PA BoN they will let you know how soon you can apply, you will not get an ATT (authorization to test) until your school sends in your verification of graduation requirements once you graduate but the state may pemit you to get your fingerprinting/background check done early. In addition about a few weeks before you graduate you can register and pay the fees with Pearson Vue but you will not be able to see the schedule of upcoming NCLEX test dates until you are issued an ATT by the BoN (you'll get an email from Pearson Vue with the ATT as an attachment...be sure to check your bulk/spam files a few weeks post graduation (especially if you use hotmail, gmail, or yahoo as an email provider as it is common for the ATT to be sent to bulk/spam).
If you are flexible in where you test and when you test you will be able to schedule your exam more quickly. When I graduated it took about a month for my ATT (but my state was still using paper applications that had to be manually entered/scanned into the database and then manually verified), but I got my ATT on Monday and scheduled my exam for the following Thursday morning in my preferred location. My classmate got her ATT about 90 minutes after me and scheduled in the same location the evening before I tested (as there was a cancellation between when I scheduled and she scheduled). the schedule is always changing but there is a fee to reschedule your exam just so you are aware.
Also familiarize yourself with the test plan, candidate booklet and rules & recommendations for the test centers (such as no test prep materials in the building, no cell phones, jewelry and attire restrictions...etc.) so you are well prepared for the big day. Good luck.