The Portuguese manager will replace Paulo Fonseca, who Roma announced earlier on Tuesday would leave the club at the end of the current campaign.
Mourinho was sacked as Tottenham boss on 19 April and had said he would "wait to be back in football" following his dismissal.
Mourinho said: "Thank you to the Friedkin family (Roma's owners) for choosing me to lead this great club and to be part of their vision.
"After meetings with the ownership and Tiago Pinto (Roma's general manager), I immediately understood the full extent of their ambitions for AS Roma. It is the same ambition and drive that has always motivated me and together we want to build a winning project over the upcoming years.
"The incredible passion of the Roma fans convinced me to accept the job and I cannot wait to start next season.
"In the meantime, I wish Paulo Fonseca all the best and I hope the media appreciate that I will only speak further in due course. Daje Roma!"
"A great champion who has won trophies at every level, Jose will provide tremendous leadership and experience to our ambitious project.
"The appointment of Jose is a huge step in building a long-term and consistent winning culture throughout the club."
General manager Pinto revealed that Roma weighed up a move for Mourinho as soon as news emerged that Tottenham had sacked him.
"When Jose became available, we immediately jumped at the chance to speak with one of the greatest managers of all time," Pinto said.
"We were blown away by Jose's desire to win and his passion for the game: no matter how many trophies he has won, his primary focus is always on the next one. He possesses the knowledge, experience and leadership to compete at all levels.
"We know that in order to build a successful sporting project it takes time, patience and the right people in the right positions. We are supremely confident that Jose will be the perfect coach for our project, for both our immediate and long-term future."