The correct answer is: C. while he was walking in the garden.

The other options are incorrect because they do not accurately describe the time when the snake bit the man. The man was bitten while he was walking in the garden, not as he was walking in the garden or after he had walked in the garden.

The word "while" is used to indicate that two actions happened at the same time. In this case, the man was walking in the garden and he was bitten by a snake. The word "as" is also used to indicate that two actions happened at the same time, but it is more informal than the word "while." The word "after" is used to indicate that one action happened after another. In this case, the man was bitten by a snake after he had walked in the garden.

Therefore, the correct answer is: C. while he was walking in the garden.