The measurement is done with the tire off, from seating bead wall to bead wall. This is the seated width of the tire. The manufacturer should state which rim width is acceptable for the indicated tire. Diameter is usually printed on the tire sidewall. But, you could also measure tire bead seat to bead seat across the diameter of the rim.
Cheers,