ATF (Automatic Transmission Fluid) is rated for "lifetime" on most cars nowadays. But if you own the car and you want it to run for a long time, it's a good idea to replace it every 30K-50K as codex stated.
I believe for manual transmissions, you probably have to replace it more often.