This is the first time I've done it.
One of the many uses of the perfect tenses is to talk about life experiences, which is why it is used here: talking about the first time doing it, the importance is placed on whether or not we have that experience, not what is happening. One might say, "The first time I did it..." but this would focus more on the events rather than it as an experience. Similarly, you could say, "the second time" or "the third time" still focusing on the experience aspect (but this is less common since usually only the first time is important). As to why it's not "I'm doing it" or "I do it" instead of "I've done it", it's that it loses the sense of experience that the perfect conveys.
This is the last time I do/am doing it.
This sentence is not focusing on it as an experience, but rather would usually be said if someone is agreeing to something or is doing something that they do not want to do ever again. It is important not to use this in the any sense of the past because last in the past usually conveys the sense of most recent rather than final, so it means something completely different. It is furthermore important not to use the perfect with this because this is a specific time mentioned, so there is no reason to use the perfect. (This could also be "will do", "am going to do", "will be doing", or "am going to be doing" if the speaker has not yet done the action.)