Pull rivets are sold
by diameter and by grip length.
Figuring out the grip length before you purchase a rivet is important because it saves you money and return trips to the store.
Figuring out the draw grip length for a rivet job. You can of course add up the thicknesses of the materials but sometimes you are replacing a rivet that has been lost or damaged so you can't take those measurements.
As a former aircraft mechanic I can pass on some knowledge of an easy way to figure out how long you need a rivet to be. You measure it right inside of the hole.
We of course used a professional tool, if you do an image search on rivet length gauge you will see a measuring device with a long thin hook that has some numbers on it. You insert it into the hole, draw back until the hook catches on the backside of the hole and read the measurement.
But you don't need to spend the bucks on one because you can create your own hooked end rivet gauge for zero dollars. It won't be as fancy but it will get the job done.
you can bend a very small L shape on a stiff piece of wire then use a fine point felt tip pen to mark the length on it at the front side of the hole and measure that distance
Or you can use a small crochet hook...
or you can cut one out of stiff plastic leaving a hook at the end
You get the idea now