As you can see, this vision is filled with symbols. It appears that John intended his readers to see in the woman clothed with the sun the people of Israel or the new people of God. The twelve stars are one indication of that. They can be taken as representing the twelve constellations of the zodiac. But they can also be seen as symbols of the twelve tribes of Israel and the twelve apostles.
First, it signifies that the most glorious queen of heaven, the true spouse of God, was crowned in eternity. Mary received the promised “never fading crown of glory” because her life so perfectly resembled that of her Son’s and because she shared in all His sufferings. -1Peter 5:4
The most perfect crown of 12 stars represents the knowledge of all creatures. In addition the crown of 12 stars is the knowledge of all the mysteries of our own faith, the manifest divine truth of whose signs Mary most perfectly grasped and most fully understood beyond the elect, above all the apostles, and above all the angelic spirits. She understood these things to a higher degree than is even possible to contemplate, let alone express. Thus Mary advocates on our behalf in the presence of God those things which are most prudent for us.