(Istvan is right, but maybe he is jumping too much into details for you to understand, at your present novice level.)
The German word 'ein' or 'einen' for the word 'a' has a different form depending on the function in the sentence. I give you an example:
1. Ein Apfel fallt auf den Boden.
Here the subject of the sentence is Apfel.
2. Ich gebe meiner Schwester einen Apfel.
Here the subject of the sentence is Ich. And I 'Ich' is doing something with the apple 'Apfel'. So the function of the word Apfel in the sentence is different. These different functions are called Nominativ and Akkusativ. But it is very very complicated. I have studied German for years now, and I still make mistakes when I should choose 'ein' or 'einen'.
Also it is not just 'ein' and 'einen' that have different forms. For example the words 'der', 'das', 'die', 'der', 'den' and 'dem' depend on their grammatical function in the sentence. (It are all words for the English word 'the'.)
And actually I am not even sure if in the example I should use 'den Boden' or 'dem Boden'. It's one of the most complicated things in the German language, also because in English and in Dutch you do not use this difference. (Dutch is my native language.)