(noun) “usual manner of behaviour”
The modern meaning was coming into English in Shakespeare’s time, and he employs it: “How use doth breed a habit in a man,” says Valentine in The Two Gentlemen of Verona (V.iv.1).
But the more common sense, rare today (except in the context of monks), is the oldest one, dating from the early Middle Ages: “costume, clothing”.
So when Montjoy says to King Henry “You know me by my habit” (Henry V, III.vi.111) or Tranio tells Vincentio that “you seem a sober ancient gentleman by your habit” (The Taming of the Shrew, V.i.65) they are talking about what people are wearing not how they are behaving.
The word approaches the modern meaning when it has the sense of “bearing” or “demeanour”, as when Gratiano tells Bassanio that he is going to put on “a sober habit” (The Merchant of Venice, II.ii.177) or when Orsino describes the twins Viola and Sebastian as having “one face, one voice, one habit” (Twelfth Night, V.i.213)