If your wood stove doesn't have a built in heat shield you'll need to keep the stove at least 3 feet away from the wall on all sides.
If your stove has a heat shield built in which is should you can place it closer to the wall such as 12 inches but you should also place a heat shield on the wall behind the wood stove anyway for more safety.
You can never be too safe with a wood stove and if you're unsure on how to safely install your wood stove yourself it's best to get a qualified wood stove installer do it for you to prevent a house fire.