Converting number of loot boxes to a price in dollars is simple since players can directly buy loot boxes and the prices are listed here. Converting number of loot boxes to number of hours played in game is a bit more difficult. There are several different ways to earn loot boxes in game.
After reaching level 22, it takes 20,000 XP to advance one level, and each level gives you one loot box. There is a breakdown of how you gain XP on the overwatch wikia, so I won't break it down here.
To convert playtime to XP I assume: 20 minutes per match, 15 of those are gametime minutes (accounting for queue, POTG, and breaks), a 50% winrate, no abandons, playing with a group half the time, winning at least one gold in 75% of my matches, never winning bronze or silver medals, competetive only, and 2 hours of gameplay per day . Therefore to convert H hours played to L number of loot boxes I get:
\[((0.75\times 60\times H)211.5+(0.5\times 3\times H)500+(5/2\times H)300+\] \[(H/2)1500+(3\times 0.75\times H)150)1.35/20000=L \]
The first term is the XP per hour earned for playing. The second term is the XP for winning games. The third term is the bonus for consecutive matches (5 consecutive match bonuses every 2 hours). The fourth term is XP bonus for winning at least one game each day. The final term is for medals per game. The factor of 1.35 outside the parenthesis is the XP bonus for playing competitive and playing in a group half of the time. The 20,000 is because it takes 20,000 XP to unlock one loot box. These can be simplified to:
\[(9517.5+750+750+750+337.5)6.75\times 10^{-5} \times H = L\]
This is actually a rather illuminating equation. By far, the largest source of XP is time in game (the first term). The others are all more than 10x smaller. The XP for medal gain is the smallest factor. The difference in winning gold every game and winning no gold is a measly 2.5%.
This equation fully simplifies to: \[0.817\times H = L\] This comes out to 1 loot box every hour and 13 minutes.
Number of loot boxes | Cost | Playtime | Real Time* |
2 | $1.99 | 2 hours | 1 day |
5 | $4.99 | 7 hours | 3 days |
11 | $9.99 | 13 hours | 1 week |
24 | $19.99 | 1 day 5 hours | 2 weeks |
50 | $39.99 | 2 days 12 hours | 3 weeks 3 days |
100 | $79.98 | 5 days 1 hours | 2 months |
500 | $399.90 | 25 days 10 hours | 10 months |
1000 | $799.80 | 50 days | 1 year 8 months |
1500 | $1199.70 | 76 days | 2 years 6 months |
2000 | $1599.60 | 101 days | 3 years 4 months |
2500 | $1999.50 | 126 days | 4 years 2 months |
This is an idealistic estimation based on my personal experience and may be very different for other players. The table also doesn't take into account the 3 loot boxes earned each week for winning 9 arcade matches or the other special situations. It also doesn't count getting from level 0 to 22 which takes much less XP.
I have created an interactive version of the XP and loot box calculator here.
This post by Paul Tassi estimated 51 minutes per loot box, and this post by BigAlChubbs estimated between 1 hour 6 minutes and 55 minutes per loot box. Their estimates are less time per loot box because they guessed between 7 and 10 minutes per match and did not include queue time.