As already stated in other answers, it’s situational and subjective.
One way I find it useful to play open notes is on bass strings, when I want to allow them to sustain and slowly decay while I progress with the melody on treble strings an octave or two higher.
Additionally, I sometimes play open treble strings in a similar way. Generally it’s in lower positions, often within a lick that also uses the same note closed, as a way to vary tone within the lick, as well as keep the note ringing while the melody progresses through additional notes.
Here’s a quick tab of a G Major blues lick that does this. Apologies if my notation is substandard, I don’t often write tabs, but at least this shows the notes and whether they’re open or closed:
Allow the open notes to sustain while the rest of the lick is played, especially the last double-stop G/D (the first open B is tough not to mute when you hit that next note on the G string, but that’s okay, it still works.)
As you can see, Major 3rd (B, in red) is played at the same pitch, both open and closed, to different effects. The first one, on the open B string, is plucked and sustains at least until the next note is played on adjacent G string, whereas the second one (4th fret G string) can be hammered onto from the preceding Bb, and mutes as soon as the finger is removed to pluck the following open G note. It gives this simple 3-note semitone phrase a different flavor than is typically accomplished by playing that note the same way both times, whether both open or both closed.