Why are some frequencies 5 digits like 51344 and some six or seven digits long like 158.7600?
It depends mainly on the culture using the frequency, the frequency value itself and how important is each part of the frequency.
In the lower frequency ranges, it's not uncommon to give the frequency in kilohertz. For example, the broadcast radio station I'm listening to right now is on frequency of 7375 kHz (or 7.375 MHz), that is to say the carrier is on 7375 kHz and the signal goes 5 kilohertz above and below and stations are places on a grid with 5 kHz steps.
If I was talking to community of short-wave listeners, they would immediately understand what 7375 means, since the modulation type and bandwidths are standardized, so there's no reason to go into details.
If I were listening to say amateur single sideband transmission, radio-telegraphy or modern digital modulation schemes, I would use more significant digits, like for example 7015.1 kHz. In such cases, the bandwidth itself is smaller (2.7 kHz in case of SSB or 300 Hz in case of telegraphy), so adding more significant digits makes sense. If you'd say go to 7015 instead of 7015.1, you'd be listening to a different station.
On the other hand, in higher frequency bands, the frequency itself is higher, so we need more digits to represent the number itself. For example, I could be listening to another shortwave radio station at 11670 kHz and because the frequency itself is higher, I need one more digit to represent it, even though the rest of the information is the same.
When we move up even higher, again the number of actually used digits will depend on the modulation type, field and channel spacing. Let's take a look at the frequency you provided of 158.7600. My guess would be that this is 158.76 MHz and that whatever service is using this frequency, they're using frequency modulation with most likely 12,5 kHz step. How did I decode this: First, you used the US tag in the question. This tells me I can try to use US traditions for writing frequencies. Next, we have 3 digits to the left of the decimal separator and 4 to the right. Looking at the left side of the number itself, I can see that it's very close to the VHF frequency ranges used for businesses in the US. This is a hint that the measurement unit is most likely megahertz. On the right side, we have decimal places. If you're using 12,5 kHz channel spacing, you would need 4 significant digits to express the center frequency of the channel itself. We have four significant digits. So everything fits. Since we already know more or less where we are, then no more digits are needed.
Do note that the number of digits used itself depends on the culture and regulations used. For example, if using 25 kHz channel spacing, we would need only 3 significant digits to the right of the decimal point. Until recently, 25 kHz channel spacing was common, so only 3 digits on the right side were used.
In some cultures, you can have reminders of previous traditions as well. For example aviation used 50 kHz channel spacing, then moved to 25 kHz. With 50 kHz channel raster, you only need 2 digits to the right of decimal separator, but they kept saying only two even when they switched to 25 kHz spacing because the third digit can be either 5 or 0 and the first two are enough to identify if the third is going to be 0 or 5. So for example, in aviation field, frequency of 119.975 MHz would be represented as 119.97. Since everything else is well-known, there's no need to say 119.97 MHz or 199.975 MHz.