It is pretty easy, say you have 6 lugs on your rim and you want to know the "bolt pattern" as they call it.
Start with a lug, call this lug #1, then go around to lug #3. Now measure between the middle of both lugs, if you have 5.5", then you have a rim that is 6 by 5.5" lug bolt pattern.
The middle opening is different on a lot of vehicles. Obviously you can not put a rim on your truck with an opening of 4" with yours being 5". Without center caps on, having an opening that is too much bigger would look funny, like it does not belong there. 4x4 trucks matter the most because of the lock outs on the front axle's.