I am currently planning my sister and brother-in-law's first trip to Italy (I've been there myself 3 times already). First, I was surprised and saddened to see you now need a ticket to enter the Pantheon. I was wondering the same thing myself about buying in advance because I didn't want to tie them to a date and time, at least not now. I emailed the Pantheon my question and at least for September, they said the tickets could be purchased a day ahead (I asked about in person, though I imagine online would be the same) and there shouldn't be any problem of running out. Hence I can wait for a long while before I advise my sister to buy them online. Unfortunately, it probably depends on the time you are visiting and how crowded it is, but I wanted to let you know. My guess is you can wait to purchase them online even the week before, (maybe 2 if busy season), especially if they always sell them at the door. Hope this helps a little at least. Enjoy Italy!