Good question. There are several different types of masks, and different reasons for using them.
Whether and how much they help is a subject of considerable debate, but since they're easy to make and apply then the best way to determine whether a mask will help you in a particular way is to make and apply one.
The Hartmann Mask (and the newer variants called Bahtinov masks) are simple covers for the objective of a telescope that allow you to easily achieve focus. These are used mainly by imagers, who need such assistance to get "close" enough to focus to avoid wasting long exposure times going back and forth between image capture and image analysis. The technique is simple: an objective cover with symmetrically arranged holes (usually two or three, often round or triangular) diffracts the incoming light and presents diffraction spikes around bright light sources. You focus the telescope while observing (or imaging with short exposures) and continue until the diffraction spikes merge into a minimum number of sharply focused spikes. That gets you close enough to begin your imaging or observing run. The usual routine is to focus in this way on a bright star, then lock focus and move the telescope to your target area with the mask removed and begin imaging.
A simple aperture mask can also be used to "stop down" the aperture of an achromat by masking off the outer few percent of the aperture's diameter. This is the thinnest region of the lens and contributes most to chromatic aberration. By masking it off, you reduce the "false color fringing" in the view or image. For a 150mm aperture, a mask with an aperture of 130mm typically presents a much more pleasing view, from the standpoint of color fringing.
An apodizing mask can be used to enhance the contrast of an image. These normally are used with larger apertures, where there is sufficient image brightness to offset the light loss due to the filtering effect. An apodizing mask is a series of screens of different density, presenting a gradient that is densest at the outer edge and thinnest in the center. For a 200mm aperture, you'd typically apply a 50% screen to the outer 10mm or 20mm, a 25% screen to the next (inward) few millimeters, and then a 10% screen for the next (inward) few millimeters, leaving the inner 130mm or so unfiltered. Depending on who you talk to, and the quality of the original view, you may find a visible improvement in contrast in the image. Planetary observers and imagers often find these masks very useful.
An off-axis mask is sometimes used to greatly restrict the amount of light reaching the eyepiece or camera for solar or lunar observing. These masks are generally separate apertures cut into a full-aperture-blocking mask, thus reducing the aperture. For a 200mm aperture, a lunar off-axis mask would commonly provide a 102mm opening. For solar viewing, a 60mm or 90mm opening is more common.
While I have used such masks in the past, I typically today rely on the quality of the optical system instead, using an aperture appropriate for the task at hand. If you have a single telescope, however, the masks provide additional flexibility. They are very popular, for example, for users of the 20-cm SCTs.
I still frequently use masks that are square or hexagonal when splitting close double stars where the primary and seconday are of very different magnitudes. A good example is Sirius and its companion. By rotating a full-aperture mask with a square hole cut in it, you can discern the companion at lower manifications, or employ higher magnifications to allow for measuring its separation. This works because as you rotate the mask, you also rotate the diffraction spikes it produces. Since most of the energy in the diffraction spikes comes from Sirius, and less from the companion, you can rotate the mask until the companion appears between the spikes and thus see it more easily.
The mask I use for splitting close doubles with a 6-inch apochromat is a simple carboard box fitted over the dewshield. The box has a round hole on its objective side, sized to be a close fit to the dewshield. On the side opposite the objective (the side facing the star), there is a square hole about 5 inches on a side. I fitted "straps" made of large rubber bands to the box, one on each side of the square hole. I then use opaque material (cut from a sheet of stiff, flat vinyl) with holes of different sizes and shapes as the actual mask. By slipping the mask beneath the rubber bands, I can apply different hole shapes and sizes easily. The shapes that seem to work best are squares and hexagons, about 2/3rds the diameter of the objective.
Does this help?