King will spend the 2019-2020 campaign with the Glasgow side having fallen out of favour with the Foxes.
The midfielder made 25 appearances as Leicester won the Premier League title in 2015-16 and he then helped Wales reach the Euro 2016 semi-finals.
King becomes Rangers' 10th signing of the transfer window, following players including Steven Davis, Brandon Barker and Sheyi Ojo to Ibrox.
The 30-year-old was present as Rangers beat Midtjylland on Thursday to reach the Europa League play-off round.
Gerrard's men will next take on Polish side Legia Warsaw for a place in the competition's group stage.