The centre-right defence minister will replace Commission President Jean-Claude Juncker on 1 November.
She secured the backing of more than half of the members of the European parliament on Tuesday evening.
The Commission drafts EU laws, enforces EU rules and has the power to impose fines on member states if necessary.
“The trust you placed in me is confidence you placed in Europe,” Mrs von der Leyen, who is the first woman to be elected president of the European Commission, said in a speech immediately after the vote.
“Your confidence in a united and strong Europe, from east to west, from south to north.”
“It is a big responsibility and my work starts now,” she added. “Let us work together constructively.”
She was confirmed by a margin of 383 votes to 327. She needed the backing of 374 out of 747 MEPs to win.
A total of 751 MEPs were elected in May, but four were absent for Tuesday’s vote.
Born in Brussels, Mrs von der Leyen has seven children and trained as a gynaecologist before entering politics.
The 60-year-old defence minister has been criticised in Germany over the armed forces’ persistent equipment shortages and what some consider to be her aloof management style.
She has promised to push for the EU to play a bigger role in social welfare, to tackle poverty, and has stressed that she would stand up for women’s rights.
She has also pledged in the past to allow a further extension of the UK’s withdrawal date from the EU “should more time be required for a good reason”.
In a speech in the European parliament earlier on Tuesday, Mrs von der Leyen made some other significant pledges:
She would push to give the European Parliament “the right of initiative” – meaning the Commission would have to legislate on MEPs’ resolutions; currently only the Commission can draft laws
On irregular migration to the EU, she said she would boost the EU’s border force Frontex to 10,000 staff by 2024, but said “we need to preserve the right to asylum through humanitarian corridors”
She offered an EU “reinsurance scheme” to bolster national insurance schemes for the unemployed.