A glass was a container for serving liquid beverages for consumption, normally made of some type of glass, but metal or wood could also be used. Different styles were created from different cultures and for different types of beverages.
Glasses were typically replicated when an individual ordered a drink from a replicator. They were also used in bars to serve drinks from bottles. (TNG: "The Neutral Zone", "In Theory"; DS9: "Dramatis Personae")
Glasses were also used to give toasts, especially at formal occasions. (TOS: "Is There in Truth No Beauty?"; Star Trek III: The Search for Spock; Star Trek VI: The Undiscovered Country; DS9: "The Adversary", "The Sound of Her Voice"; Star Trek Nemesis)