It marks a new era after the referendum on direct law-making powers in devolved areas including health and education.
The Queen said the assembly had a "well deserved reputation for diligence and competence".
Presiding Officer Rosemary Butler and First Minister Carwyn Jones welcomed her to the Senedd.
Addressing assembly members in the Senedd, the Queen, said the assembly was there to represent Wales and its people, make the laws for Wales and hold the government of Wales to account.
She said the assembly had "coped admirably" with the growth in its powers since devolution, and had a "well deserved reputation for diligence and competence."
The opening of the fourth assembly "marks a significant development in the future of devolution in Wales".
The Queen said the "vital functions of democracy" now rested on the shoulders of the assembly members and much would be expected of them.
She added: "You are now entrusted with the authority to make laws in all matters contained within the 20 subjects devolved to the assembly and, for the first time, you will be passing assembly acts.
"The performance of the assembly in discharging these new responsibilities will be closely scrutinised here in Wales and elsewhere."
Carwyn Jones called it an "important new beginning" and said it was a great honour to be first minister and serve the people of Wales.
He said: "There are challenges ahead, and difficult decisions between competing choices will have to be made, but this is fundamentally a time of optimism for Wales.  We have the powers to make a difference."
Mr Jones said his government would "work night and day" to help improve public services, to protect the vulnerable, to educate and prepare our young people for work, "to promote our industry at home and abroad, to do all we can to make Wales healthier and more prosperous."
The Queen went on to have a lunch of Welsh lamb at the nearby Wales Millennium Centre.
By Betsan PowysBBC Wales' political editor
We've seen The Queen today opening what is, in all but name, a proper Welsh parliament.
In the past, she's opened an assembly with limited law-making powers.
Now, they've been given the tools, as they said, to do the job.
The Queen is, therefore, opening an institution that can get on and forge its own path through these laws that it will start to pass.
There was no reference to Westminster, the responsibility lies here.
We can also look forward to much more drama, potentially, when it comes to that law-making process, thanks to the knife-edge election result in May.
Labour will have to haggle and compromise to get its policies into law much more than in the days of the huge majority afforded to it as a result of the coalition with Plaid Cymru.
It's going to be a very interesting five years of the fourth assembly - the key for both ministers and the assembly itself is what difference Wales will see when it's over.
A fly-past of four Hawks from 208(R) Squadron RAF Valley on Anglesey in Gwynedd took place.
Fanfares at the Senedd were performed by brass and percussion students from the Royal College of Music and Drama.
After the royal opening, the Queen and other royal visitors met guests in the assembly's Neuadd (public space).
Royal harpist Claire Jones, from Crymych, Pembrokeshire, performing before a pre-lunch reception at the Wales Millennium Centre where the royal guests met AMs.
Plaid Cymru leader Ieuan Wyn Jones did not attend the Royal opening. A party spokesman said he was still on half-term leave and would not return to work until next week.
The party's AM Jocelyn Davies replaced him in the line-up of party leaders greeting the Queen.
But his absence was criticised by Labour as "completely disrespectful" and "extremely disappointing" by the Conservatives.
Four Plaid Cymru AMs had already signalled they would not be attending: Leanne Wood, Bethan Jenkins and Lindsay Whittle and Llyr Huws Gruffydd.
Plaid's new North Wales regional AM Mr Gruffydd went to homeless charity Shelter Cymru, and Ms Wood and Mr Whittle were attending a Cardiff Bay Republican Day event.
Ms Wood said it was the third time she would not attend a royal opening of the assembly.
"My wish is for Wales to become a modern, independent country, and I cannot see any place for an outdated concept like the monarchy within it."
Ms Jenkins said she would spend the day talking to businesses in Bridgend about the economic downturn.
"I define myself as a republican so I don't believe the royal family represent what I believe in as a Welsh citizen," she said.
"I respect the people who are attending but I decided to carry on my work as an assembly member and try to represent the people of my area to the best of my abilities."
But their Plaid Cymru colleague and former presiding officer Lord Elis-Thomas said it was right that The Queen should take part in an historic day, opening an assembly which now has direct law-making powers.
He said it was a recognising the "new democracy of Wales", an occasion as significant as the state opening of parliament at Westminster.
"It's our day - a day for celebrating Wales within the UK constitution," he said.
"We live within a parliamentary constitution which has a monarchical structure - if people want to have a debate about whether there should be a republic and we had a referendum, there's no question about which way I would vote."
The Senedd's new Presiding Officer, Rosemary Butler, AM, told BBC Radio Wales afterwards that she faced a "very interesting task" in steering the members forward to make sure its new powers were used "for the people of Wales".
She added that the debating style of the AMs in Cardiff was different to MPs in Westminster.
She said she was confident that all the political parties would work together and if there is "confrontation" then she will "have to be more strict".
There was also room to "communicate better" with the people of Wales about the Senedd's work, she added.
The reception at the Wales Millennium Centre was used to showcase new and established Welsh talent, including choir Only Men Aloud.
Personnel from No. 4 School of Technical Training, based at MoD St Athan, Vale of Glamorgan, took part in parade duties with members of the Air Training Corps from around Wales.
A referendum in March gave assembly members the right to make laws for Wales in 20 devolved areas without requiring the permission of the UK Government.
The queen opened the assembly with Labour in government but without an outright majority.
The party won 30 of the 60 seats in May's elections.
The assembly has developed ceremonial elements of previous royal openings by engaging the Wales Herald, the Honourable Thomas Lloyd, and enhancing the role of the Macebearer, David Melding AM.
The Wales Herald takes part in occasions such as the State Opening of Parliament.
The mace is the symbol of the royal authority by which the assembly makes laws.
Ahead of Tuesday's royal visit, a ceremony entitled the Celebration of the Mace took place at the Senedd.
It emphasised the need for greater understanding between different sectors of society.
The Queen officially opened the fourth session of the Welsh assembly in Cardiff Bay, saying it had "coped admirably" with its growth in powers.