When are students or instructors expected to bow and to whom?
For spectators, family, friends or anyone else not participating, is anything expected of them as signs of respect?
Not really. Bowing is mostly a Japanese phenomenon. Even then in Shorinji Kempo (a japanese style) we don't bow but rather put our palms together in a traditional Buddhist greeting.
In Chinese arts they tend to make a rough yin/yan with the hands. In boxing you touch fist with your opponent.
As for when to bow this also varies. Generally it's some or all of the above:
When entering/leaving the dojo. (directed at the shrine)
When stepping onto or leaving the mat. (directed at the shrine)
To the instructor at the start of class or when given advice.
To the judge at the start of a match.
To the opponent at the start of a match (after bowing to the judge)
To the opponent at the end of the match.
To the judge at the end of the match. (after bowing to the opponent)
To acknowledge a hit that has been scored in a match or practice session.
(to whoever scored the hit)
To the practice partner before and after you train with them.
There are not usually any formalities expected of spectators or anyone else not participating. However normal formalities for the culture are obviously expected.
In other words each martial art has it's own ettiquette. You just have to learn it for the martial art you are studying.