Ash never catches a Totodile in the anime.
In the Johto region, his starter is Cyndaquil, caught in Episode 165 (EP165): "A New Chapter!" (Japanese: Wakaba Town! The Beginning of a New Journey!).
Totodile was caught by:
Ash’s water-type in Johto was primarily Totodile’s evolution line via other trainers, but he himself owned Cyndaquil → Quilava → Typhlosion.