You have two issues that have to be resolved when when tax issues involve two states:
- where did you have residency while you earned that money.
- where did you work when you earned that money.
Once that has been established then you determine where you have to pay taxes. Generally it is where you did the work. But if there is reciprocity between the states then they may have agreed that you pay taxes based on where you were living. Check both states tax authority website for information.
When determining residency the states will care about where your mail was sent, where you are registered to vote, where you registered your car, where you went when the contract ended.
You have to determine if you did enough enough that New Jersey will claim you lived there. Otherwise PA might have a claim on your income taxes.
When you determine your correct state of residency you might run into another issue: NJ may penalize you if you should have registered the car or gotten a drivers license because you lived long enough in the state. That information will be a separate issue on the NJ Motor Vehicle Commission website. There may be taxes, and penalties associated if you missed deadlines. There may also be insurance requirements.
Where the company withheld the taxes may not be a determining factor. They may have withheld NJ taxes because you told them to. In that case they were not responsible for determining the correct jurisdiction.
Of course even if it was a simple mater of clean breaks when moving from state X to state Y, you may have had too much money withheld in one state vs another especially if you had income while living in PA and then moved to NJ.