While Judaism, Buddhism and Hinduism all had early influences in Afghanistan, it is Islam that, since the 7th century, has defined Afghanistani culture. Almost the entire population of Afghanistan today identifies as Muslim, but within that population exist numerous fissures dividing people between ethnicity and religious sect. Most Afghanistanis ascribe to the Sunni branch of Islam, with most of the rest identifying themselves as Shia. The distinction dates back to the earliest days of Islam. In addition, Afghanistan is the birthplace of Sufism, a more mystical, and some think more humane interpretation of Islam -- a distinction that makes the country's Sufi population a regular target of attacks by militant Islamists like the Taliban movement. So pervasive a part of Afghanistan's culture is Islam that the religion cannot be separated from discussions of that culture.
One effect of religion upon Afghanistani society, then, is that it acts as a unifying force, binding all those who identify with the nation of Afghanistan despite its myriad divisions among majority Pashtuns and minority Hazaras, Tajiks, Uzbeks, and other ethnicities. While serious differences exist among the nation's population with respect to levels of religious orthodoxy, all but about one percent of the population is Muslim.
A second effect of religion upon Afghanistani society is the obverse of the first effect. While Islam serves as a unifying dimension to this fractured nation, the divisions within Islam and among ethnicities that comprise Afghanistan make religion a casus belli among many of the more militant or extreme factions of society.
A third effect of religion upon Afghanistani society is its tendency toward intolerance toward non-Muslim peoples. While only the barest fraction of the country's population does not identify as Muslim, that fraction lives under the constant threat of attack, and conversions from Islam to any other religion are forbidden as part of the nation's culture. The tiny -- they number around 1,000 in a population of over 30 million -- population of Hindus live in a state of constant fear as the intolerance associated with the Islamist extremism embodied by the Taliban and Islamic State threatens their very survival. In short, Afghanistan has devolved into one of the least tolerant states in the world. As the Taliban and other fundamentalist movements and insurgencies regain power in Afghanistan, the role of religion on society at large becomes more pervasive and pernicious. [On the role of the Islamic State in Afghanistan, and its conflict with the Taliban, see "Taliban in Afghanistan Tell Islamic State to Stay Out of Country," Washington Post, http://www.washingtonpost.com/world/asia_pacific/taliban-warns-islamic-state-to-stay-out-of-afghanistan/2015/06/16/a88bafb8-1436-11e5-8457-4b431bf7ed4c_story.html]
On a more positive note, Islam, when practiced with the kind of tolerance and respect characteristic of such Islamic countries as Indonesia and, during the 20th century post–World War I, Turkey, can be highly beneficial to a nation's development. Afghanistan before the Soviet invasion in December 1979 was nobody's idea of a model country, but it was largely peaceable and the unifying influence of Islam was a major reason for its cohesiveness and identification as a single nation.