When they were originally bred in the First Age, the Orcs had little more language than beasts, but borrowed what they could from other languages and corrupted it to their liking. In the Second Age, Sauron corrupted and combined Valarin and Quenya to create Black Speech, which he intended to make the official language of all who served him. He ultimately failed in this purpose, although several generations of Orcs were probably bred in Mordor and raised on this language before the War of the Last Alliance.
After Sauron's defeat at the end of the Second Age the Orcs were divided. Eventually they had almost as many dialects as they had groups and settlements, and "Orkish" quickly became useless to them for inter-breed communication. So most Orcs learned to speak a debased form of Westron for this purpose. By the late Third Age the Goblin tribes of the Misty Mountains adopted this primitive dialect as their official language, and Saruman later had it taught to the Half-orcs and Uruk-hai of Isengard. The Black Uruks and Uruk-hai of Mordor also spoke Westron, but their first language was a debased form of Black Speech combined with Orkish. There was also a new breed of small tracker Orcs known as "Snufflers" originally bred in Mordor. These particular Orcs spoke Westron in the company of Uruk-hai and Black Uruks, which meant that they did not share the same language, and instead had their own language or knew only Westron.