David Evans, who worked for Labour under the leadership of Tony Blair, and was seen as the favourite of Sir Keir, was backed for the role by the party’s ruling National Executive Committee (NEC) on Tuesday.
Sir Keir said: "I look forward to working with David to build a team that can help us restore trust with the British people and build a team that can win the next election."
Former assistant general secretary Mr Evans said: "We face a defining period in the history of our great party, with a global pandemic, an imminent recession and a mountain to climb to win the next election."
The appointment follows the stepping down of Jennie Formby, a close ally of ex-leader Jeremy Corbyn, from the role.
Sir Keir said that Ms Formby had quit by "mutual consent".
One of Mr Evans’ key issues will be dealing with allegations of anti-Semitism by some party members, and a probe by the equalities watchdog into the situation.
The Equalities and Human Rights Commission’s inquiry is set to be made public soon after years of internal strife within the party over how allegations of anti-Semitism have been handled.
The appointment is being seen as a boost for Sir Keir, who took over after the worst Labour result in a general election since the 1930s last December.