Astrology as in the belief that the heavenly bodies control our fate is condemned in the Bible. But there's also astronomy, which is the science used to create calendars.
The Sun and the Moon are for times and seasons and a good calendar takes both into account. Months, even today, are based loosely on the lunar cycles. The lunar cycle takes about 29.5 days to complete, which is why months alternate between 30 and 31 days (i.e. due to the fractional .5). The reason we use 30/31 rather than 29/30 and have February as only 28 or 29 is to keep the year at the 365.24 days required for the solar year. The fractional part (which goes beyond .24) is why we need leap year. So the calendar is a balancing act between the Sun (which requires 365.24 days) and the moon (which requires months of 29.5 days).
Different solutions were used in ancient calendars (such as an extra 13th month in leap years, with leap years obviously being based on a different calculation), but the basic idea has always been the same since the beginning: to use astronomy to create a calender that balances the requirements created by the movements of the Sun and the Moon as they were understood at the time.
Knowing what month it was was very important in the Old Testament to keep the appointed feasts at the right time, like Passover, Tabernacles, etc.
The Hebrew calendar as it is used today, based on rabbinical calculations, has 12 months alternating between 29 and 30 days long, with an extra 13th month on leap years. A whole month is added on leap year because the year normally has only 354/355 days in it, which means there are more days to make up to get back on track with the Sun on a leap year (every 19 years), and the calculation doesn't truly accomplish this perfectly.
Also of interest may be the Babylonian calendar, Lunar phase, Tropical year.