There are many options for making a pinhole camera, the easiest by far is to remove the lens from a normal camera and replace it with a pinhole. Apart from getting a camera which can be used with a shutter release cable and that has a "B" setting for long exposures the only other thing to say is to make sure everything is light tight.
If building from scratch, what you need is a light tight box, something to wind the film on (and back if using 35mm film) and a shutter. It's that simple.
It is best to paint the inside of the box black to reduce light bouncing around inside, and if you are using a wooden box like mine, it is a good idea to use a few coats of paint as I could still see some light coming through the box with just one coat.
The shutter could be as simple as a piece of black tape, or it could slide like mine or you could use a swivelling shutter. Again it needs to be light tight at all times. Most black tape will let light through.
The film winding part will be the hardest to make and stop light getting through.
The shutter assembly and the internal slots are made from lollypop sticks, which can be bought in most craft stores.
I used a bike spoke for the winder, I tried a thick paperclip but the steel wasn't strong enough.
It's hard to see in this photo, but the shutter (made from an old floppy drive casing) slides in a groove lined with self adhesive felt from a lightproofing set I got on Ebay. I decided to have the shutter in between the film and the pinhole so I can change pinholes and put extensions in to change the focal length with film still in the camera. It would be much easier to do it the other way round but not as flexible.
The pinhole assembly is attached with magnets to the shutter. The duct tape is to stop light getting through the crack which ruined my first film. At some point I'm going to add wood sides to this so it slides onto the shutter and will look better and be easier to use.
The back slides on tightly and the interlocking provides enough lightproofing.
You can also see some foam I glued in to stop the film rotating too easily.
1/4 inch nut is held on with expoxy resin to attach to the tripod.