Strangely, the answer is simple, they used their salpinx (that’s what they called their trumpet) for pretty-well everything. From what you read, however, they were principally treated as military instruments. That’s partially true as, for much of the time, neighbouring Greek states were at war with each other. Accounts tell how signals given by the salpinktes, that’s the trumpet player, were used to control troop movements during battles
In civil life, the salpinx was used for all manner of civic events, such as calling the people to assembly, heralding great men on important occasions and calling an accused person to court.
They were also used in the games to call competitors to an event and produce a fanfare for the winner. There are even accounts of the salpinx being played during social gatherings and starting off competitive drinking competitions.
By classical Greek times, brass instruments were well integrated into religious rituals and the games were not seen by the Greeks as a purely athletic event but were held to celebrate the Gods, particularly Zeus.
In later Greek times, during the Hellenistic Period, the salpinx began to be used as an art instrument and is depicted being used alongside the hydraulis, an organ which was the first keyboard instrument.
Image: A Hellenistic Salpinktes