I entered Poland before the war, my visa-free regime ended, and before it expired (end of January) I applied for temporary residence and I have a stamp. Is it possible now to go to Ukraine for a few days and come back to Poland?

As a rule, the mere fact of waiting for a residence decision and a stamp in a passport confirming the submission of an application is not a basis for entry into the territory of Poland. This means that under normal circumstances, in order to re-enter Poland, you must obtain a visa or wait 90 days and enter on a visa-free basis. 

Nowadays, the practice at the border operates in a way independently of the law, so it is very likely that such a person will be allowed into Poland, but it is difficult to predict on what basis and what consequences this would have on the further situation of stay.

If at the moment of entry the decision to grant a permit has not yet been issued and the foreigner does not have a temporary residence card, the (re-)entry into the territory of Poland may be qualified as constituting grounds for the foreigner to be covered by the Act on assistance to citizens of Ukraine. 

However, there is no clear interpretation in this respect and no unambiguous position of the authorities.

If, when a foreigner re-enters Poland, he or she no longer has the permitted days of stay under the visa-free regime, entry to Poland may take place on the basis of the consent of the commanding officer of the border guard post. This consent, however, allows her to stay in Poland for 15 days and her attitude towards her stay in Poland, while waiting for the decision, is also not obvious. However, it is assumed that as long as the procedure for granting a residence permit is pending (until the final decision on the matter has been issued), the stay of the foreigner is considered legal on the territory of the Republic of Poland, even if he re-enters the territory of the Republic of Poland during the proceedings.

Therefore, in order to be sure that your stay in Poland will not be considered illegal, we recommend that you stay in Poland until you receive a decision on granting a residence permit.