On each track there are 2-3 pit stops depending on how long the track is, you can only repair your car if it is damaged, by power ups or hitting track items.
To repair at the pits simply drive through it, when damaged a wrench icon will come up on screen to show you where the pits are, do this 10 times and you will unlock this, however this will come through natural play.
You can see how many repairs you have triggered in 'My Stuff - Statistics & Collection' then scroll down to repairs.
Here's a video to demonstrate