This phrase actually contains personification of stars and a metaphor for evil.
“Stars hide your fires” is personification. The stars are being asked to give Macbeth darkness, so no one can see his “black and deep desires.” Calling his desires black and deep is a metaphor, because the thoughts are not literally dark, but he is saying they are dark because they are evil. Here “dark” is a metaphor for evil. His thoughts are evil because he needs to commit murder in order to get what he wants.
In Act I, Scene 5, Macbeth discovers that he has been named Thane of Cawdor, as the witches promised, but he has not been named Duncan’s successor. Macbeth says that the prince is in his way.
The Prince of Cumberland! That is a step(55)
On which I must fall down, or else o'erleap,
For in my way it lies. (enotes etext p. 18)
The current prince, Malcolm, is in his way. Macbeth needs to be king. He needs to kill Duncan and get rid of Malcolm, the prince, in order to do it. This is the evil and dark thought he does not want anyone to see.
Macbeth's ambition has been awakened by the Weird Sisters' prediction that he will become king, so when King Duncan names his older son, Malcolm, the Prince of Cumberland and his heir to the throne, Macbeth's thoughts turn dark. He says,
Stars, hide your fires;
Let not light see my black and deep desires. (1.4.57-58)
In these lines, Macbeth employs a figure of speech called apostrophe. Apostrophe is when the speaker addresses something that is not alive and cannot respond as though it is alive and could talk back. Macbeth speaks directly to the stars, asking them to go dark so that no one and nothing will be able to see signs of his dark ambition. The use of apostrophe does personify the thing the speaker addresses in a very minor way, but only insofar that it attributes to that thing the ability to respond.
Ultimately, these lines also help to show the audience the beginning of Macbeth's transformation from loyal and brave to traitorous and tyrannous. He knows that he is thinking evil thoughts, and rather than try to repress them, he asks the stars to go dark so that he will be better able to hide them.