Stay on the territory of Poland during the period of validity of the entry and stay entitlement like visa, temporary residence permit, permanent residence permit, long-term resident's EU residence permit.
Moreover, foreigners exempt from the visa requirement may enter and stay in Poland under the so-called visa-free travel. The conditions of entry and stay and the list of countries whose citizens are exempt from the visa requirement can be found HERE.
Futhermore, if you submit an application for legalization of your stay in Poland during the period of validity of one of the above-mentioned entry and stay entitlements, and the application fulfills all the formal requirements, your stay in Poland will also be legal until the final decision regarding residence permit is issued. The condition of legal stay, regardless of the entry and stay entitlement, is possession of a valid passport.