According to the letter of the law, in theory you should, according to article 15 of Population Register and Identity Cards Act (Ustawa o ewidencji ludności i dowodach osobistych) you ought to do that at latest the last day before leaving you current address.
Art. 15.
§1. Osoba, która opuszcza miejsce pobytu stałego lub czasowego
trwającego ponad 3 miesiące, jest obowiązana wymeldować się w organie
gminy, właściwym ze względu na dotychczasowe miejsce jej pobytu,
najpóźniej w dniu opuszczenia tego miejsca.
[...]
§3. Osoba, która wyjeżdża poza granice Rzeczypospolitej Polskiej na
okres dłuższy niż 6 miesięcy, jest obowiązana zgłosić swój wyjazd oraz
powrót właściwemu ze względu na miejsce pobytu stałego organowi
wymienionemu w ust. 1. Zgłoszenia wyjazdu dokonuje się najpóźniej w
dniu opuszczenia dotychczasowego miejsca pobytu, a zgłoszenia powrotu
– najpóźniej w 30. dniu, licząc od dnia powrotu.
Rough translation
Article 15
§ 1 A person who abandons the place of permanent or temporary residence
of more than three months, is required to unregister at
municipality having jurisdiction over the place of former residence,
at the latest on day of leaving said residence.
[...]
§ 3 A person who goes abroad leaving the Republic of Polish for
a period longer than six months, is required to report the departure and
the return to the municipality having jurisdiction over the place of former residence
as listed in § 1. Notification of leaving should be carried out at the latest
on the day of leaving the current place of residence, and reporting the return
— no later than within 30 days of the return date.
However, this is mostly dead law, which is never enforced. The only consequence for not doing so is that whoever is living in that address for more than 3 months can unregister you themselves. Which is pretty much the same as if you'd just unregister yourself.
In practice it is a good idea to not unregister, as being registered with municipality in Poland simplifies a lot of bureaucratic procedures. This is advised even by some of the municipality clerks (off the record of course). This is not just my experience, I've heard that from multiple sources.
From my personal experience, it's been 10 years since I've moved abroad and I have not unregistered. Did not have any issues because of that. On the other hand this helped me greatly fast-tracking things like getting papers ready for getting married in Poland, getting my kids registered and getting their Polish birth certificates, etc.