Use D1 for everything normally.
D3 prevents the transmission from going into 4th (Overdrive) gear. As tucker said, if you find the transmission "hunting" between 3rd and 4th, then select this gear. (American cars tend to have an "Overdrive Off" button/selector instead.)
D2 locks the vehicle in 2nd gear. From a stop it will begin in 2nd (not 1st) and it will not leave 2nd as you increase speed. As Tucker said, use this for when on a slippery surface (snow, sand, etc). It helps prevent the wheels from spinning too quickly and losing traction.
All gears can be used while descending a steep hill to use engine/transmission braking to slow and control the vehicle (instead of riding and overheating the brakes).
Gears can be changed "on the fly" while driving without issue.
For instance, the other day I had a lot of deep fresh snow I had to pull through in my parking lot when I left work.
I started the vehicle in D2 and once I got clear of the drifts I shifted in D1 and continued on my way.