I have a pokemon Emerald Version and I've played 100 hours. I don't want to lose the data so I wanted to know how much more I could play until it stops and becomes unable to save.
I've had Ruby since it came out. I tried it a few weeks back and everything worked fine. So it should last a pretty long time.
If you have a gen 4 game (Diamond, HeartGold etc) what you could do is migrate your pokemon (and items if they hold them) to those games instead. (You won't be able to send them back though.)
when your internal battery goes out, you don't really lose any data, except that you can't do time based events. but as for how long, i don't know, sorry.
I've played Emerald for over 200 hours and it still works, so it should be fine.