If you have been living together for 12 or more months, go for residency as soon as you can.
If you have been living together but for less than 12 months, then you don't meet requirements for residency as of yet.
Applying for residency does not entitle you to interim visa, so if your visa expired and you haven't got decision on residency, you would have to leave the country.
The best thing to do is, apply for residency and if no news 1-2 months before your current visa expires, then apply for work visa as well. In case there is delay with work visa application, you would be granted interim visa to legally stay in the country until decision is made.