This will be another long answer, because there's an insane amount of cars/classes/series.
In almost all of them, there is an "open" set up to race, where there's tons of studying and work put into set ups, and if you don't have a really good one, you're not competitive. And then there's a "fixed" where everyone runs the same set up. (For reference, all of the NASCAR events that have been on TV, have utilized "fixed" set ups) "Open" races are much longer.
Glancing at schedules, I'd guess these are the race lengths for officials races (that count towards your license and safety rating)
NIS, NASCAR iRacing Series (NASCAR) - anywhere from 60-100% of laps (that are ran at the actual race/track)
A Class (NASCAR) - Usually about 25% of laps, races last 45 minutes-hour (Currently at Richmond, races are 65 laps in "fixed", "open" runs 110)
B Class (Xfinity) - Usually about 25% of laps, races last 45 minutes-hour
C Class (Trucks) - Usually about 25% of laps, races last 45 minutes-hour (Currently at Richmond, races are 55 laps)
Then you have tons of the smaller pavement series, indy cars, modifieds, late models, legends, silver crown, etc. I'd say the simple answer is 25% of the actual events for official races? And then hosted events range anywhere from 10 laps to 500.