The Indian Rebellion of 1857 dissolved the British East India Company, transferring power from the company to the empire.
As such, the Queen became de facto Empress off India, but not by title.
She took on the position after the 1874 general election, which put Benjamin Disraeli in power.
He passed the Royal Titles Act 1876 through Parliament two years later, providing her with the title in an official capacity.