What is this part of the polish language called and how does it work?
"Masz mapa gratis?" This is incorrect.
"Masz mapę gratis?" Correct.
How can I know when and how to change the end of the the word mapa? What is the name for this, is it a declension?
Other wrong examples maybe:
Masz lampka gratis?
Masz książka gratis?
Masz kubek gratis?
Masz krześło gratis?
Yes, it's declension (deklinacja or odmiana przez przypadki). There are seven (in practice six, the seventh is quite limited) grammatical cases (przypadki) in Polish and it's a long process a) to learn the different endings (that depend on the case and on the gender of noun) and b) to learn when which case should be used.
Which case to use will result mainly from:
- the verb (like in your example, the verb "mieć = to have" requires an Accusative case (Biernik),
- the preposition ("travel/go/walk to" requires a different case than "stay/be/remain at").
In your exemples the Accusative case would be:
lampkę, książkę, kubek, krzesło (you made a spelling mistake, there's no "ś" in krzesło, just "s", although there are different cases and sometimes the "ś" will be used as well, in the form "krześle" which is Instrumental case - Narzędnik).
And of course it's even more complicated, if you substitute the loan-word "gratis" with and adjective (bezpłatna, darmowa) then the adjective needs to be declined too.
Masz bezpłatną mapę?
As I wrote, there are seven cases (in singular and in plural), but the number of endings for a word is usually (always?) lower, some cases have identical endings, unfortunately the identical endings don't follow a straight forward pattern, it depends, again, on the gender of the noun and on some other factors (I don't want to annoy you with the details right now), but as you could see, the neuter noun (krzesło) and the masculine, object - not a person or animal, noun (kubek) have identical endings in the Accusative and Nominative cases, while the femminine words (książka, lampka, mapa) have different endings.
A very simplified, but much easier version:
It's the accusative case. Always with the word mieć (mam, masz, ma etc.), and many other words as well. "The thing one has is associated with the accusative case".
Nouns that normally (which means nominative case) end in -a, end in the accusative case in -ę.
Words that do not end in -a, usually don't change when converted into the accusative case.
This is not always true, but it's a much eaiser rule to learn (to start with).