Minimum: 1.5mm
Here's a dead rim that failed in this way.
Surprisingly, the tyre was fine and I still ride it. The inner tube has a massive ragged burst with lots of tentacles so was unpatchable.
This happened while doing a normal inflation to around 80 PSI. There was a brief "tink" noise like what one might get from spokes when stress-relieving a wheel, and perhaps a second later BAM I had the neighbours checking what the noise was, and my hearing was affected for hours afterwards.
I had been standing and using a track pump; I hate to think what would have happened if I had a minipump and had my head right by the wheel.
![enter image description here](https://cdn.statically.io/img/i.sstatic.net/SwOuT.jpg)
![enter image description here](https://cdn.statically.io/img/i.sstatic.net/FqnzX.jpg)
Update:
![enter image description here](https://cdn.statically.io/img/i.sstatic.net/kpgwe.png)
At the middle of the failure, the exposed metal is 0.7mm thick.
![enter image description here](https://cdn.statically.io/img/i.sstatic.net/tmmLO.png)
Closer to the ends, the exposed metal is 1.2 mm thick.
![enter image description here](https://cdn.statically.io/img/i.sstatic.net/hVdX4.png)
As an approximation, your rim should be no thinner than 1.5 mm wall thickness at any point.
This assumes a rim brake, with wear on the brake track. And that the rim is made of Aluminium with no additional brake track added.
To measure these distances you can't use a caliper or a micrometer because the bead hook will be in the way.
To do this measurement you need a tool called a Double Ended Caliper or sometimes a "Figure 8 Caliper" that looks like this:
![enter image description here](https://cdn.statically.io/img/i.sstatic.net/uwpj7.png)
Source: https://federatedtool.com/robert-sorby-977-double-ended-calipers-7/
These calipers simply transfer the gap from one place to another, and you read off the measurement at the other end using measuring calipers.
A fancy metal set would be nice, but you could make something adequate from cardboard, or I have designed a printed one at https://www.tinkercad.com/things/7GkwHr7pZJb-double-ended-calipers
It is functional but could be better.
![enter image description here](https://cdn.statically.io/img/i.sstatic.net/wLHLI.png)
My "good" rim turns out to be about 2.0 mm thick. However the tolerance of this tool is suspect - it would be better to use gauge blocks or feeler gauges to measure small distances.
![enter image description here](https://cdn.statically.io/img/i.sstatic.net/2oaqu.png)
![enter image description here](https://cdn.statically.io/img/i.sstatic.net/XNaBf.png)