Do you have to get divorced in PA if you only lived there for less than 5 years?

No you do not have to get divorced at all. I'm not quite sure I understand this question. You can get divorced in any state no matter how long you've lived there.