Cobalt Blue is a bright middle blue, while Ultramarine Blue is more violet-toned. But Ultramarine Blue also comes in a range of shades, from a Green Shade that is almost identical to Cobalt Blue, to a more violet-toned (and usually more granulating) deep or French shade.

Hue: Cobalt Blue is unmatchably bright and clear, the platonic ideal blue. Ultramarine Green Shade is almost the same color, but slightly more violet-toned. Ultramarine Blue is an electric-violet color. French or Deep ultramarines are more violet-toned.
Granulation: This Cobalt Blue is not very granulating; the WN Ultramarine Green Shade is about the same low level. (Note that some companies offer Cobalt Blues that are very granulating, like Daniel Smith.) As you move further toward violet-toned Ultramarines, they also become more granulating.
Opacity: All of these colors are transparent.
Toxicity: Ultramarine Blue is a nontoxic pigment. Cobalt Blue is toxic if ingested (made from the heavy metal Cobalt). This is a potential reason to opt for Ultramarine if you worry about your paints being eaten by pets/kids etc.
Palette Appearance: Cobalt Blue looks just as bright when dry in the palette – it’s unmistakable – whereas a dry pan of Ultramarine looks like a nondescript dark blue.
Price: Big difference here. Ultramarine Blue is among the cheapest watercolor pigments (series 1 in DS, WN and other brands that group their paints into price series). Cobalt Blue is generally one of the more expensive ones (series 3 in DS). As of this writing, a 15ml tube of Da Vinci Ultramarine Blue costs me $9.80 and a 15ml tube of Da Vinci Cobalt Blue costs me $15.
Color Mixes
Imidazolone Yellow (PY154)


Cobalt Blue makes greener greens, compared to the more muted/grayish greens from Ultramarine Deep.
Raw Sienna (PBr7)


Both of thee are useful mixers with Raw Sienna, mixing dark blues, grays, and yellow ochre hues. Cobalt Blue’s colors are more green-toned, less neutral, and almost greenish. Ultramarine’s mixes are, in my opinion, a bit more beautiful here, including the lovely gray and the rich muted ochre. However, the green tone of the Cobalt ochre more accurately reminds me of the actual colors of dry reeds in my environment.
Burnt Sienna Deep (PR101)


Both of these blues make beautiful grays and browns with my transparent PR101 earth orange. The Ultramarine colors get darker and are just a tiny bit warmer (more red-toned).
Quin Magenta (PR122)



Cobalt Blue and Ultramarine GS have a very similar set of mixes. UGS is maybe slightly more color-separating. Ultramarine Blue makes slightly darker mixes. All of these are extremely amazing vivid purples!
Cobalt Turquoise (PG50)


Very similar; the mixes make color-separating sky blues that make interesting alternatives to Cerulean Blue. Cobalt Blue mix has less range and (in this formulation anyway) less granulating.
Conclusion
Cobalt Blue and Ultramarine Blues have a lot of similarities. They mix similarly. Both make gorgeous violets with magenta, and neutral grays with earth orange.
Cobalt Blue has a special kind of magic, with is bright cheerful hue, so perfect for clear blue skies; and its floating granulation makes purples look ethereal.
But Ultramarine is just such a useful powerhouse on the palette. With a wider range, it can make darker browns and deeper shadows. With its violet bias, it distinguishes itself more from other popular palette blues (good violet blues seem to be rarer than green blues). It doesn’t paint a one-color sky as well as Cobalt Blue, but it’s irreplaceable as the zenith in a two-color blue sky gradient. (Which are better anyway IMO.)
The true test: when I kick Cobalt Blue off my palette in favor of Ultramarine Blue, I usually do fine… but when I kick Ultramarine off in favor of Cobalt, I tend to come crawling back to Ultramarine at some point.
My Pick: Ultramarine Blue. It is just more versatile, has a wider range, mixes more usefully. It doesn’t hurt that it’s a lot cheaper, either.