a) to use all your determination to continue in spite of difficulties:
Just grit your teeth and hang on - it'll be over soon.
b) to bite your teeth together, especially when you are in pain, angry, or under pressure:
'No, that's alright,' she said through gritted teeth.