For some time, Teal'c had been disillusioned by Apophis and the Goa'uld way of life. He knows what he's being asked to do is not right, but has to stay his tongue and actions at the risk of death for him and his family. When SG-1 arrives, Teal'c believes they might be able to do something to help him (dialog from the end of S01E01):
O'NEILL (to Teal'c) I can save these people! Help me! Help me.
TEAL'C Many have said that. (He turns and fires on his own guards, then throws his weapon to O'Neill.) But you are the first I believe could do it!
It is revealed much later in the series the process by which Teal'c becomes disillusioned. Mainly, this is done by his mentor and trainer, Master Bra'tac. Master Bra'tac was the First Prime of Apophis at the time of this, which is all revealed in Threshold (S05E02). In this episode, after Teal'c basically loses his mind and believes he is back in the service of Apophis, Bra'tac helps him to remember who he has become and why. It is Bra'tac's original training and philosophies which help Teal'c believe as he does. Due to this training, he is not willing to act upon it knowing the outcome. His belief is the ultimate reason why he chose to go with O'Neill, because he actually does believe O'Neill can do what he says and save the people. This is something Teal'c has wanted all along, but has had no means to accomplish, nor support to proceed. He believes O'Neill and the SG-1 team can provide both, so makes a split second decision to rebel against Apophis.
(Side Note: IMHO, this is just a plot ploy to get Teal'c embedded into the show. It is a very weak action which gets him to join SG-1, but the writers had to bring him in somehow.)