I read or heard somewhere that the Romans used to add gods of the civilizations they defeated to their pantheon. I tried googling different terms but couldn't find anything about it. Am I imagining it or is it true?
If it is true, why did they do it? When did it start? Did they ever skip the adoption of a god? And which gods did they adopt?
They did adopt deities from foreign religions in a few instances and equated them with their own pre-existing deities even more often, but it was not as simple as conquering a region and taking their gods.
It was not often that deities were adopted outright from foreign traditions, but one notable instance of this occurring was in the case of Apollo. Apollo was originally a Greek deity with no Roman equivalent, but one of the first times the Roman Senate had a set of prophetic texts called the "Syballine Books" passed down from the last king of Rome (Tarquinius Superbus) consulted due to several crises that Rome was facing, it was advised that the worship of Apollo with the added Roman epithet "Pheobus" (making Phoebus Apollo) be implemented and a temple dedicated to him, as well as integrating the worship of another Greek prophetic deity, the goddess Cybele. The Gallic horse-goddess Epona was also adopted by Romans, being the only Celtic goddess widely worshipped throughout the Empire.
The most common phenomena where foreign deities were worshipped was called interpretio Romana when applied by Romans and interpretation Graeca when done by Greeks, and essentially was just when deities, myths and practices resembling their own were encountered in foreign settings. These deities were seen as different interpretations of the same beliefs and were worshipped in their syncreticised forms. For example, the Egyptian deity Osiris was often likened to Dionysius/Bacchus (Dionysius-Osiris) because he rose from the dead, and was equated with fertility, or Zeus being equated with Ra. Gallic deities were also compared like Wotan being viewed as Mercury. Other times, Roman male deities such as Mars or Apollo being paired with Celtic goddesses (Sirona and Apollo being one example of these pairings). An interesting thing about the names of these fusion deities is that the first part of their combined name is almost always Roman giving supremacy to their Roman aspects over their foreign ones (the Gallo-Roman god Jupiter Poeninus or the Roman-Egyptian god Jove-Amun).
One thing to bear in mind is most pagan polytheistic religions were not based around a standard dogma, but were really more a collection of traditions that varied from location to location with some more popular deities being more widespread than others and even the nature and spheres of influence for these deities varying from place to place. This made incorporation of foreign deities with similar attributes a natural fit.
I looked it up here and there are many similar questions to yours
/u/AnUS-27 answered an older question like this
Did ancient polytheistic religions view themselves as mutually exclusive to one another?
As a supplement to cleopatra's answer, another searchable keyword for this process in Rome is evocatio deorum (the "calling away of gods" from their origin and into the Roman Pantheon).