You get stars on your magic pin by combining them. You can only combine the same pins together, i.e. fireworks and fireworks. Not fireworks and ghost. Each star shos the number of pins you have combined. The result is a longer effect and a shorter recharge time.
where do you see the stars? And do they last after you've gotten rid of a magic pin?
You can see the number stars on the pin when looking at it through the inventory screen. The stars stay with the pin, if you have one magic pin you have one star. If you have two magic pins with one star each and combine them together you get one two star pin. If you were to trade the pin or sell it it would be gone from you like any other pin.
The stars don't go away by using the magic, the more stars on a magic pin the longer the effect and/or the shorter the recharge time.