Payments made by an eligible PA retirement plan (i.e. a 401(k)) to an individual by reason of qualifying for retirement under the plan, are excludable from PA gross income for tax purposes.
The key issues here are is your employer's 401(k) an eligible PA retirement plan and did you qualify for retirement under the plans provisions. Check with you employer about the plans status (eligible or not). If you were allowed to retire under the PA eligible plan provisions (by reasons of years of service), then you may exclude the distributions. If your plan did not provide for retirement until age 55 (or later) or if you needed more years of service (i.e. you just quit and took a distribution) then your distributions will be taxable.
Your former employer or plan trustee should be able to give you a little more information about their eligibility status and whether you qualified to retire under the plan provisions.