When should I apply?
You should apply for a temporary residence permit if you wish to stay in Poland for a period exceeding 3 months and your primary purpose of stay is work.
You should apply for a residence permit in person before your current legal status expires (i.e. before your visa or residence card expires).