If it is a clear, hot, summer day, then a roofing crew of 5-6 can tear off and replace a 40 square asphalt shingle roof in a single day (a square is roofing terminology for shingles. 1 square = 100 square feet of shingles).
If temperatures are mild, then they can install up to 50 squares in a single day. This is assuming the roof is not steep and is not architecturally complex. This is the simplest of scenarios. You can broadly calculate other jobs using this as a baseline.
But many factors can change this time frame. Calculating roof replacement duration requires a few primary factors with the addition of some uncontrollable outliers: weather and structural damage.
Obviously, the weather can stop an installation cold in its tracks for as long as it desires, and structural repair can prolong the job anywhere from half an hour to a full day depending on the extent of the damage.
But for the sake of normalizing a time frame, assume the weather is favorable, and there are no structural damages to the roof.