Hi, thank you for contacting JustAnswer.com. My name is Russell. I will do my best to provide the right answer to your question.
A summary of how-to-do-it, for time exposures, is to put the 'Shutter Speed' into Manual mode, then choose 'Bulb' mode. Which can be set for something above fractions of a second.
Or you can set to the Shutter Speed to 'Time', which means, the shutter opens with one press of the shutter button, and closes with another press of the shutter button. Any interval, but you have to close the shutter with a second press.
Here's the page on the subject of Time Exposure for your Nikon camera type:
If you want star trails, a medium ISO Speed setting, but a long exposure (e.g. with 'Time' setting for Shutter Speed) is OK.
For relatively 'instantaneous' photos that won't show the stars as trails, but rather as relatively point sources, you need a high ISO Speed, and a shorter exposure.
If your camera has a NR (noise-reduction, or anti-shake) feature, a long exposure should use that, of course.
And a tripod helps too, unless you have a stone wall to set the camera upon.
If this answers your question, please rate my answer. A five-star rating would be appreciated!
If you need more info, or have any comments, use Reply To Expert to respond.