I'm looking for the Shakespeare quote that ends "and learn to hate the day," concerning a deceased person, cut into stars and put in heaven.
I'm not certain that Shakespeare has a quote about that, but you may be thinking of a poem by Edmund Spencer called "Daphnaida".
Spencer (who is more famous for his work "The Faerie Queen") wrote it for Douglas Howardwho was an heiress, mourning the loss of her husband. Some critics say that Spencer wrote it to criticize her for what Spencer saw as overboard mourning. In the poem, Daphne represents Douglas and Alcyon represents her husband, Arthur Gorges.
People will often refer heartbroken teenagers to it because of the very meloncoly nature of the poem which can be akin to your first break up or other teenage love situations such as when Edward leaves Bella for her own good in New Moon. The lines you may have been thinking of are as follows from Daphnaida:
I hate the day, because it lendeth light
To see all things, and not my loue to see;
I hate the darknesse and the dreary night,
The expression "cut into stars" can be found in Romeo and Juliet:
Give me my Romeo; and, when he shall die,
Take him and cut him out in little stars,
And he will make the face of heaven so fine
That all the world will be in love with night(25)
And pay no worship to the garish sun.
Juliet says these words at the beginning of Act III, scene 2, just before she learns of Tybalt's death. She is longing for night to come when she will see Romeo, her new husband, again. The fact that she says that "all the world will be in love with night" is what makes you think that "learn to hate the day" is part of the quotation.
I hope this helps you.