why it’s so expensive for Non-EU
Because it's subsidised by taxpayers!!!
And of course, there'll be some profit in there too!
If they're public institutions, there are no shareholders so they can't make a profit. All European educational institutions are under pressure to generate income to reduce government subsidies and I don't think that Poland is an exception.
If I got a polish residence (by job or something there let's say for 2 or 3 years)
Which fees would they apply on me EU/EFTA or Non-EU ?
To qualify for EU fees you'd need a Polish citizenship which you can apply for after 5 years of residency.