I want to put up a door in a spare room that is already 82" in height. If I want to put the door to one side of the wall are studs necessary on that side of the wall or can I nail the prehung door right to the wall? Or am I better off centering the door and install studs on both sides?
You can't nail the door right to the wall. There wouldn't be room to open the door even 90 degrees because the doorknow would hit. Also, you couldn't trim around it and it would look bad. The door needs to be at least far enough away from the wall that a piece of trim can go from the wall to the edge of the door casing. You might as well go a little more and give it some "breathing room". I would recommend putting a new stud in around 3 inches form the wall, so here's what you can do: Attach 2 2x4s to the wall, one after the other. That will space the door out 3 inches. Then cover the 2x4s with drywall or somethign to match the other wall. Then put the door in. Also, you will want the hinges of the prehung door on the same side of the close wall, so the door opens against the wall. If you had to open the door away from the wall to go in or out, that would be awkward.
A prehung door is usually hung centered in a wall. The molding that forms the sides of the prehung door, called jambs, are generally 4 1/2 inches wide, the thickness of a 2x4 (actually about 1 1/2 x 3 1/2 inches) stud plus 2 sheets of 1/2 inch drywall.
The door does swing to one side, and you can turn it either way. You need to decide which room you want the door to open into and which side you want the hinges on in that room. Prehung doors come in left hinged and right hinged versions.
If you are cutting a hole in the wall for the door (as opposed to putting it in an existing opening), you need to frame out the opening
The prehung door then fits within this frame. All illustrated boards are 2x4 studs except the header which is usually either 2x4 or 2x6 depending on the width of the door.