If you are thinking about getting a mountain bike, do you need to get shocks on it? Depends. The most basic mountain bikes do not have shocks, but as the price level increases, you will quickly find that mountain bikes will have either front-only shocks (hard-tails) or else full suspension, both front and back shocks (soft-tails).
Having shocks definitely affects the comfort of your ride as well as performance. It used to be that hardtails could accelerate faster and climb better than full suspension bikes, because they were lighter and you didn't lose any transfer of energy to the rear shocks, but today's full-suspension bikes are nearly equal to hardtails now in that respect. If you are riding any bumpy terrain, you'll notice (and lament) the lack of rear suspension in a hardtail bike pretty quick, especially feeling it in your back and backside. Unless you absolutely cannot afford it or are only going to be riding very smooth trails, go ahead and get shocks, at least in front.