Is a delisting a sale?
No. The tax on capital gains concerns a paid disposal of securities (art. 17 sec. 1 pt 6 and art. 30b sec. 1 PIT Act). A delisting is a decision of the exchange or the company, not your disposal: you receive no money, so there is no income, and the purchase cost stays in the position. The program keeps the shares as an open position at their purchase price and enters no amount in PIT-38.
When does the loss arise?
When you sell the shares or the company is liquidated. Example: you bought 100 shares for 2,000 PLN, and the broker delisted the company. PIT-38 for the year of the delisting shows no trace of it. The next year you sell the shares for 50 PLN: income 50 PLN, cost 2,000 PLN, a loss of 1,950 PLN in PIT-38 for the year of the sale. When exactly a loss arises in a liquidation depends on the documents of the company and the broker; if in doubt, ask a tax adviser.