I did something in the past. Now, when I mention it to others, should I say:
It was the first time I did that.
or:
It was the first time I do that.
Which part of English grammar should I have a look to understand it?
To be totally correct, you should actually say,
It was the first time I had done ____
which is the past perfect tense. However, you may also hear the simple past used, which is the first of your sentences.