I know that different sizes are sold but when should I be using a taller vs. shorter tee. Is there an appropriate time or is it just preference?
I had once used longer tees when using a driver, but I hardly use longer tees anymore for this purpose.
I used longer tees to make contact with the ball on the upswing of my tee shots using a driver. The driver is the hardest club to hit, and making contact with the ball on the upswing promotes distance. Also, contact is typically imminent using a driver off the tee due to its typically larger clubface compared to other clubs. I no longer use longer tees due to accuracy. Instead, I use the length of shorter tees for this purpose.
I use shorter tees (usually, with only the top tip of the tee exposed) to make contact with the ball on the apex of the downswing of my tee shots using woods, hybrids, and irons. These clubs are not as hard to hit as the driver, and making contact with the ball on the apex of the downswing promotes solid contact. This is called "hitting down" on the ball, and typically, especially with irons, a divot would be made on these shots, on or off the tee.
In my experience, I have not found this to be preferential as I do not know anyone who makes contact with the ball on the upswing, on or off the tee, using woods, hybrids, or irons. In addition, it is rarely feasible to make contact with the ball on the upswing of non-tee shots.
Longer tees are typically for woods and your driver, while shorter tees are for irons.
The modern driver is a deep-faced club, so the distance between the sweet spot (which you want to put right on the ball) and the bottom edge of the club (which you want to avoid dragging over the ground) is the greatest of any club. In addition, most instructors tell you to tee the ball forward in your stance, often just behind your leading foot, so you're hitting up and out at the ball as you come out of your downswing; this gets you the optimum launch trajectory for maximum distance while minimizing backspin.
This club, therefore, definitely calls for a deep tee. I tend to tee my drives with the ball's thickest point (as seen by the club) right at the upper edge of the face of my driver, and slightly inside the centerline. That allows me to take a swing that clears the "deck" and hits into the ball on the upswing, sending it right down the line. To get the height I want, I use about a 2.5" tee.
However, practically every other club you might use from the tee box, even your higher-numbered woods, you more often hit from the turf on par-4s and 5s. You don't want to mess with that too much on the tee box; All the tee is providing here is a low-friction base and clearance from any irregularities in the turf of the tee box (which, for holes that call for a mid-iron off the tee, can get pretty chewed up). For holes that don't call for a drive, if I use a tee at all, I use it to just barely clear the turf so I can get the impact point up into the sweet spot of whatever club I use without taking too big a divot. Sometimes, I'll raise a teed ball for my 3-wood off the turf just a little bit to get some of that "hit up into it" action for better distance and less backspin.
In these situations, I often scout around real quickly for a broken tee another golfer's discarded, with about half an inch to an inch of shaft on it, and use that instead of a full intact tee.