To make a fair description of the role of religion in people’s lives from Middle Ages to 21st century you should consider a specific geographic region or society, because in many places it has not changed that much, while in some places Christianism or Buddhism has grown a lot becoming the main religion. Per example in places like Brazil they did not have Christianism in Middle Ages as the native people were not Christians at all until the colonization process, in 21st more than half of the population is Christian.
But in general if you look to Europe the role of religion has changed a lot regarding first conduct, in Middle Ages religion played a very important role in defining what was right and wrong, in terms of behavior and based it on religious beliefs. These beliefs also influenced and controlled science and knowledge, in 21st this role of ruling behavior has been substitute by the law, now the religion still has its view of sin and influence or guides people’s values but the law is not based on religion but in many other elements, so the law is based in most countries in a secular state, where the religion and the state are separated institutions. Also in Middle Ages the king or the government were seeming as a kind of representatives of God on Earth and had a close relationship with bishops and the popes, now they are elected by the nation's desires.
So briefly the main role of religion in peoples's lives from Middle Ages to 21st differs in how religion relates to politics, science and law.