"One prevailing theory concerning the origin of "dressed to the nines" surrounds the significance of the number nine. Some sources believe that the number 9 possessed a spiritual or cultural strength, much like the numbers 3,7 or 13 do today. For example, there were nine Muses said to inspire mankind's pursuit of the arts. If someone were described as "dressed to the nines", it could have been an outfit capable of impressing the nine Muses. The expression "to the nines" was actually in popular use before "dressed to the nines" came into vogue. It's entirely possible that the reference was meant as a tribute to the Muses or other significant figures.
Another theory states that women of the Middle Ages would often wear fashionable gloves as part of their formal wear. These gloves were said to contain nine buttons from wrist to elbow, so if a woman was said to be "dressed to the nines", she would be wearing her most formal evening wear. In a similar vein, the price for admission for theatrical performances often ranged from one shilling for a front row seat to nine shillings for the preferred balcony or box seating. Anyone who could afford the highest ticket prices might be considered "dressed to the nines" as opposed to the unwashed groundlings seated on the grass in front of the stage."