Static ropes are used whenever you're working with a static load, either raising or lowering.
Dynamic ropes should be used whenever there is potential for a fall and high impact forces.
Static ropes are used for rappelling/abseiling, ascending, hauling, rescue work and making anchors (accessory cord). Pretty much they are to be used in every situation except for catching a fall.
On rappels, static ropes (9-11mm) give you more control on your descent, with dynamic ropes it's often very temping to descend faster because the rope will soak up a lot of the force when you come to a stop, while fun to do, it's not great for your gear or your anchors, you could also put yourself into a dangerous situation by lowering too fast and hitting something or losing control.
If you've ever tried to ascend a dynamic rope then you know that it is almost twice as tiring as ascending a static rope, it's the same difference as climbing up stairs vs, hiking up a sand dune. The stretch and bounce in the rope puts excess fatigue on your muscles with every motion, you also feel like you have to climb twice as far because you have to take the stretch out of the rope before you can make any vertical progress.
Hauling is done on big wall climbs typically using >7.5mm ropes when you're climbing for multiple days and carrying a lot of gear, static ropes are much easier and faster to pull.
In rescue work, large diametre 13mm ropes are pretty much standard, because they regularly have more than one person on a rope and lift victims strapped to a spine board in a basket. You want zero stretch in your rope when you're doing this kind of work, because before you can lift a load you have to first take all the stretch out of it, and when you're dealing with a spinal injury you don't want your rig to bounce around. They also use very complex pulley systems, with dynamic ropes, you would have to pull way more rope through the system.
Accessory cord can be categorized as any static rope that is <8mm, it's used to make cordalettes, equalettes, any other kind of anchor or 'lette you can think of, slings, prusiks (although dynamic prusik cord is better, static cords still work), and back in the day it was used in every size down to 2mm to thread your chocks. You're really only limited by your imagination when it comes down to what you can use accessory cord for.
Dynamic ropes are used to absorb shock forces sustained from a fall, if you were to use a static rope for free-climbing the force of a fall would rip your protection out of the wall, or snap you in half when your fall is caught and you stop very suddenly and abruptly.