In standard 4/4 time, a whole rest has four beats, but this varies depending on the meter of the piece of music. Overall, a whole rest endures for the same amount of time as a whole note.
The meter, denoted with a time signature, determines the amount of time that each note in a measure lasts. The top number signifies the number of beats in one measure, and the bottom signifies the note value that has one beat. For example, in standard 4/4 time, a quarter note has one beat and there are four beats to a measure. Extrapolating this ratio, one whole note takes four beats, which means one whole rest takes four beats.