Does the ISO change automatically in a DSLR?

E.g the nikon d5000?

It can, depending if the particular model has this feature, and if you allow it to do so.
I believe the D5000 does, in fact, have an Auto ISO feature.

Most dSLRs have an Auto ISO function when using it's Auto mode (the D5000 included). But, surely you would want to select your own? You would of course need to use a shooting mode other than Basic (idiot) mode…

You can make it change automatically as well as change it yourself

Nikons have a great Auto ISO mode. It lets you pick the ISO you want, but if the necessary combination of shutter speed/aperture will not work with your chosen ISO, it automatically changes it. You can set it in the Camera menu in PSA or M modes.
Mine on my D90 is set to a 1/30 sec.minimum shutter speed and a max ISO of 3200. That means that, in dim light when my camera is set to ISO200.

Only if you set ISO to Auto. It is independent from the Auto on the mode dial.

You can set iso to automatic in some cameras, however if your struggling with understanding iso check out my photography website. I wrote a post on understanding iso you can find the link below
http://www.cameracity.info/which-iso-setting-to-use-%E2%80%93-camera-basics-explained
- Does the iso of the film dictate the iso in the camera?
- When you buy a camera off the nikon site, does it automatically come with a lens?
- Why does my Nikon 1 J1 camera stop recording automatically?
- Street Lamp Photography exposure? Higher ISO & Lower Shutter Speed or Lower ISO & Higher Shutter Speed?
- Street Lamp Photography exposure? Higher ISO & Lower Shutter Speed or Lower ISO & Higher Shutter Speed? - 1