The answer depends on the application and overall weight.
Most modern wheels for Gravel and Allroad feature just 24 spokes. For long tours in remote places 28 spokes are recommended, because in case of a broken spoke the wheel remains usable, whereas with 24 it might buckle too much to carry on.
For heavier riders and ultimate durability, we recommend using 32 spokes.