Lived and worked in New Jersey for 9 months, got married and moved to Pennsylvania

Hello,

 

I need to file an extension and will be filing jointly with my husband. I lived in New Jersey for 9 months out of the year and worked and still am working in NJ and then moved to Pennsylvania after getting married. Do i need to file an extension for both states? or just PA?