Ray Palmer's mentor, Dr Alpheus V. Hyatt, found a way to open a tiny portal into the past, large enough to push an arm through but nothing more. While he experimented with this 'time pool', The Atom decided to hitch-hike on the experiments and become a time traveler.
At first the device only worked randomly, however after some work he upgraded the machine so that he could lock into specific times. Often, as Hyatt experimented, Ray Palmer would travel through the portal as the Atom (being small enough to fit into the portal) for various cross-time adventures and to help Alpheus collect items from other eras.