Because in the sentence "Our neighbor is a student", "Our neighbor" is the subject of the sentence which makes it nominative: Наш сосед.
In this sentence, I (Я) is the subject of the sentence and "our neighbor" is the (direct) object which makes it accusative: "Нашего соседа".
Generally (though there are things that will make this untrue):
Subject = Nominative
(Direct) Object = Accusative
(Indirect) Object = Dative
Not necessarily. Here's how it is:
наш is the nominative form for masculine singular.
нашего is the genitive form for masculine and neuter in singular.
But we're talking about accusative, so why am I bringing those up? Because it's the easiest to begin with those, and then add:
- For masculine animate, the accusative case copies the genitive.
- For masculine inanimate, the accusative copies the nominative. So:
"I see our house" becomes Я вишу наш дом;
"I see our neighbour" becomes Я вижу нашего соседа (and not наш сосед).
Ok, i would try to make it clear: 1.) Subject is ALWAYS nominative 2.) some words, especially verbs, requires a word in specific form or with a specific preposition (which also requires a word in a specific form ;-) ). for ex.: videt' acc. (to see something) znat' acc. (to know something) net gen. (is not) dumat' ob loc. (to think about somethink) further example: Ya (sub. so nom.) vizhu moyu drugu (acc.) So i advice you to learn the verbs not just like dumať = to know, but dumat' ob koshke
The endings correspond with the number (singular/plural), sex (masculin/feminin/neuter) and case (nominative/genitive/prepositional/dative/accusative/instrumental). So theoretically there should be 36 different endings. In reality a lot of them have the same ending, although this makes things actually more complicated. Welcome to Russian grammar!