How can I legalise my stay in Poland?

1. Non-EU citizens may be required to have a visa.

It is an official document that allows you to enter a foreign country legally. Proper type of visas would grant you access to Poland and legalise the period of your stay in the country. 

A student visa allows you to enter Poland for education-related purposes only and stay for a predetermined amount of time. Details: gov page

2. EU citizens don’t need a visa to enter Poland

However, in the case of stays longer than 3 months, students should register their stay. The application for the registration of residence of a UE citizen should be submitted in person to the relevant province governor (PL: wojewoda) in charge of EU citizen’s residential affairs (in the case of stay in Warsaw: gov page), not later than on the next business day after the expiry of the 3-month period from the date of entry to the territory of the Republic of Poland. Details of the procedure: gov page