I've been playing Zelda OOT on my N64 for a long while now, since I was around nine years old. It took me a while to first beat the game, and when I did, I discovered that I was able to beat the final boss, Ganondorf/Ganon over and over, and he/they would never permanently go away. I'm wondering if this is a feature of the game, and is supposed to happen, or if it's a bug and my cartridge is broken.
This is intended behavior - there is no "post ending" gameplay, so the final save sets you right at the beginning of the final dungeon with all the puzzles complete. Your options from this point are to either turn back and explore Hyrule - and obtain any heart pieces/equipment you may have missed, or go beat Ganon(dorf) again. Or start a new save.
This is fairly standard for adventure games of this sort, and even more so for the era in which it was released/developed.