The most important characteristic of a rim is its bead seat diameter. It should match the intended wheel bead seat diameter of the bicycle, although in some cases for bicycles having disc brakes it may be possible to fit smaller than original wheels (but then the bottom bracket might be too low, causing pedals to hit the ground in corners). Most common bead seat diameters are 559mm (for most mountain bicycles) and 622mm (for most road bicycles), although there certainly are other sizes available as well.
After the bead seat diameter, the second most important characteristic is adequate spoke density. An inadequate spoke density in a bicycle having disc brakes may lead to the front wheel spokes to loosen if braking hard. Also, an inadequate spoke density may cause the spokes to loosen even if not braking hard. An inadequate spoke density in disc brake front wheels can be mitigated by using large-flange hubs (but it's heavier than a small-flange hub); and inadequate spoke density when not braking hard can be mitigated by using a stiff rim (but it's heavier than a less stiff rim). Quality bicycles have standardized on 36 spokes per wheel, which is what e.g. Jobst Brandt and Sheldon Brown recommended. In fact, Sheldon Brown called using less than 36 spokes "The Great Spoke Scam". For 559mm bead seat diameter wheels, 32 spokes gives similar spoke density than 36 spokes, and the spokes transmit disc brake torque as well as 36 spokes in a 622mm wheel. Too loose spoke density is a major headache and should be avoided, thus being the second most important characteristic of a rim.
Lower than 36 spokes per wheel may work if a number of conditions are met:
- The spoke count is not ridiculously low, i.e. something like 20 is clearly out of the question but 32 might be acceptable
- The rider is lightweight
- The rider never brakes hard with a front disc brake
- The front hub has large flange if it's a disc brake hub to cause as small spoke tension changes as possible when braking
- The rim is very stiff (i.e. its second moment of area is large)
- The spokes are flexible (i.e. as thin as possible and butted/swaged, not straight gauge)
- The spokes are evenly tensioned (which is only possible with an accurate-tolerance rim)
- The spoke tension is high (which in practice needs a rim strong around spoke holes, i.e. using double eyelets)
- The wheel size is small so the spoke density is not low despite low spoke count
- (Seriously, don't do this as it makes spoke adjustment hard:) The thread between spokes and nipples is secured by thread glue
Ideally, when selecting a rim one could compare their manufacturing tolerances because better-tolerance rims make it easier during wheelbuilding to achieve even and high spoke tension. However, in practice the only definitive thing about this that can be said is that quality rims from brand names have good tolerances. Usually you get what you pay for. Cheap no-name brands should be avoided.
The material of rims is usually aluminum, as steel is heavy and offers poor wet braking for rim brakes, and carbon fiber is prone to fail catastrophically after an incident that may have weakened it in an invisible manner. The catastrophic failure can happen "just riding along", if the rim has a history of such incidents. Aluminum rims are manufactured by extrusion.
A good rim has a double wall design, although for fatbikes such a rim would be heavy and single wall rims are used. The reason is that a double wall rim has a larger second moment of area, i.e. it is stiffer and thus distributes the load over a larger number of spokes. The single wall design for fatbikes is not a problem as fatbike tires provide lots of cushioning so they never see high momentary loads.
If the rim is intended for rim braked bicycle, it must have brake tracks. Rim brake rims can be used for disc brake bicycles but the converse is not true. Thus, if there's a possibility of ever needing rim brakes on any bicycle used, it makes sense to build wheels only with rims that have rim brake tracks.
The brake tracks would ideally have wear indicators. Two common designs are groove and small holes. The groove has a problem that if the rim and wheel are very precisely build, it can wear an identical groove in the brake pad, and a groove in the brake track may need a tubular section behind it to strengthen the rim. Small holes that are visible when not worn and disappear when worn are stronger, thus not needing any additional strengthening material behind them, and cannot wear a groove in the brake pad, so this is the preferable wear indicator design.
Good rims withstand large spoke tension. The best way to achieve this is usually double eyelets / sockets made out of steel. Such double eyelets make wheelbuilding easier (no possibility to drop a nipple inside the rim channel accidentally), and make the rim stronger. If the rim does not have double eyelets, it should at least have single eyelets, although double eyelets are heavily preferable.
One major decision is whether the rim should be tubeless ready. Double eyelet rims are not tubeless ready, so one has to choose between easy wheelbuilding and strong rim able to withstand spoke tension, and the possibility to use tubeless tires. It may be harder in some cases to mount tires on tubeless ready rims than non-tubeless-ready rims, so if there are no tubeless plans, it may make sense to standardize on rims having double eyelets that are not tubeless ready.
Rims that require use of nipple washers should be avoided, as wheelbuilding with such rims takes more time.
Anodized, especially hard anodized, rims should be avoided as they have reduced fatigue life and thus can crack around the spoke holes. Preferable finishes for rims are polishing and powder coating. Black rims are not always anodized -- if the finish is smooth like paint, it is probably powder coated, whereas if it is rough, it is probably anodized.
Good rims are drilled for Presta valves. One can always enlarge the valve hole if needing to use Schrader valve. The opposite (reducing hole diameter) is not possible. A Presta valve hole is not much larger than spoke holes so it does not weaken the rim, whereas a Schrader valve hole is always a weak point in the rim. Besides, using Presta valves in rims drilled for Schrader valves is difficult, requiring the use of specially shaped valve locknuts and grommets.
Good rims have hooks at their sides, allowing the usage of high pressure clincher tires. Only such hooked rims should be used. They can be identified by "C" after their width, e.g. 622-19C means 622mm bead seat diameter, 19mm internal width, hook-type rim.
If selecting a rim to replace an existing rim, spoke reuse (which is the preferable way to rebuild an already spoked wheel) is possible only if the effective rim diameter (ERD) is similar. Millimeter or two millimeter difference may be acceptable, but over 5 millimeter differences should be avoided. Unfortunately, rims go out of fashion very quickly and thus it may be hard to find a rim having the same ERD as some existing rim in an already build wheel. Thus, it may make sense to keep a small stock of good rims so that rebuilding wheels with new rims is possible.
Rims are available in many widths. There is a chart showing which tire widths and rim widths are compatible. For example, 28mm tires can be used with 15mm, 17mm and 19mm rim internal widths. As it is usually not justified to use a tire size narrower than 28mm as narrow tires need exceptionally large inflation pressures, provide a harsh ride, and have worse rolling resistance even on smooth steel drums (and thus much, much worse rolling resistance on non-smooth roads), and sometimes one might want to use a much wider tire than 28mm, it may not make sense to use a rim narrower than 19mm internal width. A very wide tired bicycles which never use 28mm tires should obviously use a rim internal width of more than 19mm.
Lastly, one should consider rim weight as well. Usually manufacturers aim for the smallest possible weight, so if selecting a rim of a certain design from a brand name manufacturer, you can almost always know its weight in advance from the requirements. One should not obsess too much about weight as a little extra weight does not take the joy away from bicycling.