He thanked Iranians for their support, after securing 62 percent of the votes.
Raisi is Iran's top judge and holds ultra-conservative views. He is under US sanctions and has been linked to past executions of political prisoners.
Iran's president is the second-highest ranking official in the country, after the supreme leader.
Raisi will be inaugurated in early August, and will have significant influence over domestic policy and foreign affairs. But in Iran's political system it is the country's supreme leader, Ayatollah Ali Khamenei, the top religious cleric, who has the final say on all state matters.
Iran is run according to conservative Shia Islamic values, and there have been curbs on political freedoms since its Islamic Revolution in 1979.
Many Iranians saw this latest election as having been engineered for Raisi to win, and shunned the poll. Official figures showed voter turnout was the lowest ever for a presidential election, at 48.8 percent, compared to more than 70 percent for the previous vote in 2017.