I'm aware of many different brands, gauges, and alloys used in manufactured guitar strings. Is it necessary for me to try each type and brand to optimize the sound of my guitar, or do the type and brand of strings not really affect the way a guitar sounds?
Brand doesn't matter at all, in my opinion. Most of the big names do make their own strings (contrary to some rumors you'll hear on the internet) but they're all using the same processes, similar or identical machines, and probably exactly the same materials - because wire drawing is somewhat specialized, and the volumes of guitar strings isn't that big compared to the investment required to draw wire, most of the manufacturers buy the raw wire from companies like Mapes
Gauge is going to matter, especially in how your instrument plays. The pitch produced by a string under tension is determined by Mersenne's laws, which relate pitch to three factors: length, tension, and mass. Alloy will affect mass, and I'll get to that in a moment, but gauge is the big factor. Bigger gauge = more mass. The more mass, the more tension must be place on the string to bring it up to pitch. More string tension = greater resistance to fretting.
It also means a greater difference between the "speaking length" of the string (the part that's actually vibrating) and the "scale length" of the string (the distance from nut to bridge saddle). So changing gauges means your intonation will change, and you'll probably need to make adjustments at the saddle to stay in tune.
Many players say that heavier gauge strings have "more tone". Timbre really isn't a plus or minus thing, but changing the mass and speaking length will change the distribution of overtones, so you'll have a different sound. Whether it's better or not is subjective, and depends on both the musician and the genre.
Alloy effects can be big or small - it depends. The most dramatic effects of alloy will be seen when you're using magnetic induction pickups (like the single coils found on Fender Stratocasters or the humbuckers used on the Gibson Les Paul). These types of pickups use the string's interference with the pickup's magnetic field to generate a current that your amp turns in to sound. Metals like iron, nickel, and cobalt will induce strong currents. Metals like aluminum, copper, brass, and silver don't. So if you replace your Slinky strings (nickel wrapped) with 80/20 bronze (80% copper, 20% tin) you're going to experience a dramatic plunge in volume. And it won't be even across all strings - all high E and B strings, and the cores of all other strings, are made from Swedish steel.
If you're using a different type of pickup (piezo, transducer, optical, in-body microphone) or no amplificaton at all, then that part won't matter.
But alloys vary in density. Tin is less dense than copper, so "phosphor bronze" (about 7.7% tin) is denser than 80/20 (20% tin).
Since the mas is one of the inputs into Mersenne's laws, the density of the strings will affect the amount of tension and the string diameter. Both will affect the distribution of overtones, and the sound you get.
I do think the type of string can have an effect on how a guitar sounds. With the huge variety of strings on the market (even a single company might have dozens to choose from for just one type of guitar) unless you have super deep pockets and way too much time on your hands your best bet is to just take a stab at a few general brands, alloys, and gauges to see if you can get yourself in the ballpark of what you like. It also wouldn’t hurt to speak to other players you know to see what their preferences are.
Using the process of elimination you might start with 3 brands of the same gauge and alloy to see if you notice a difference. If you like one brand more than the others then you can then repeat the process, but with the same brand, different alloys. You can also flip flop and start with alloys in one brand then switch to brands.
I think gauge is probably the least to worry about as you probably already know which gauge you prefer within one or two sizes.
I don't know the difference between different makes, but gauge and type can make a significant difference.
Gauge can matter in an two indirect ways as well as any direct difference.
The first is that how you play alters the tone and is in turn altered by gauge. The tension difference between the lightest string gauges I use and the heaviest is about 3/2, and this makes a really big difference to how you can play the instrument. In particular it alters how hard you can pluck the string and vibrato & string bending. The latter is perhaps not 'tone' but it certainly alters what the instrument sounds like. The former does alter tone for reasons which are I think related to nonlinearities in the attack part of the note. I can also play a lot more quickly with heavier strings: on light strings everything just turns to mush as I'm a bit clumsy. Again, not quite tone but it does alter what the instrument sounds like
The second, less-obvious, way is that gauge alters where the wound/plain break is, and wound strings sound significantly different than plain strings: their tone is just different to start with, I suspect it changes faster with string age, and for round-wound strings there are all sorts of squeaks and noise as you fret wound strings which just don't happen with plain strings. So a (heavier gauge) set with a wound third is just a different thing to play than a set without. You can almost play a guitar with a wound third entirely on the wound strings, while you really can't with a plain third (for instance you can't play a 7th chord entirely on wound strings without omitting notes).
Type also matters. I'll just give a personal example. I play mostly semi-acoustics using a wound third. Traditionally I've used round-wound strings. Round-wound strings are fairly squeaky on archtop guitars, so a while ago I thought I'd like to try flat-wound strings so they'd not be squeaky and also to try the jazz-purist thing (I also bought a beret). The manufacturer I use makes a flat-wound set which is identical in gauge & set tension to the round-wound set I used meaning I could just swap it in. And when I tried them my first response was ... I should just immediately throw them away: there's radically less top for the wound strings and, at least superficially, less sustain too (I think this may be because the high-frequencies get damped much faster, so there is sustain but it's all fundamental). But also no squeaks, and the strings feel completely different to play which again alters how you play and thus indirectly what the instrument sounds like. Well, I've got used to them and I probably will keep using them on that guitar. But they are not like round-wound strings, at all.
Having said all that, I think it's also important to not endlessly search for elusive newness: different strings are unlikely to make as much difference as just practicing will.
For classical guitars, strings make a significant difference as they are the major source of the sound. A lot depends on what you like though. I personally prefer slightly tighter strings as I like to feel the pull of the string and therefore the "pull" of different intonations when plucking. My brother (we have both played since young) prefers slightly looser strings as he finds it easier for him to play. As for make, I usually stick to the better known brands, but I don't really notice a difference - I am no sound expert, nor a professional musician though.
Whenever I am asked, for a beginner, I always recommend buying a cheap guitar and expensive strings - my "party" guitar was £20 with £40 strings - as at the real bottom end of the quality scale, strings increase the sound quality for much less money than getting a guitar that actually sounds better. As for gauge - I say get mid range until you have been playing for a while then try some others to see what you like.
At the professional end of the scale, again it comes down to what you like the sound and feel of - you are just dealing with bigger prices...
My two cents is that I believe I can feel when I have D'Addario because they feel better than Ernie Ball Slinkys. I don't believe for a moment that there's a profound difference in sound, though.
There's likely differences to be told between the different alloys used in the windings, but I haven't spent the woodshed time and string money to catalog and develop opinions on these things. A video from Rick Beato demonstrates the effect of string gauge. Many think thick strings mean more tone, but they can also mean muddier tone.
Getting a string to pitch involves length, thickness and tension, and the combination that works for you might not work for others.