Pryd is used with questions e.g "Pryd ydy'r sioe yn dechrau?" (When does the show start?) a good way of remembering this is that originally "Pryd" was "Pa bryd" (What/Which time/period), and pan is used with statements e.g "Pan mae'r egwyl yn dechrau dwi'n mynd i'r toiled." (When the brake starts I'm going to the toliet.)
You may even care less about this, but pan is 'bread' in Japanese, as well (...a loan word from Spanish 'pan', of course).