Once you have had a residence permit in Sweden for five years, you can apply for long-term resident status in Sweden. You can do this even if you apply to extend your current residence permit. The Swedish Migration Agency will then examine both applications.
If your current residence permit will soon expire, it is a good idea to apply to extend that permit, even if you have applied for long-term resident status in Sweden. Otherwise, you risk having to leave Sweden if your application for long-term resident status in Sweden is rejected and you do not have a valid residence permit or an open application for a continued residence permit in Sweden.
Keep in mind that you will need to pay the application fee for both applications.
Read more on the page You want to apply – Long-term residents in Sweden