Must publicly funded research in the EU be published as open access by law?
The European commission has a webpage dedicated to this issue. In summary:
All projects receiving Horizon 2020 funding are required to make sure that any peer-reviewed journal article they publish is openly accessible, free of charge (article 29.2. Model Grant Agreement). [...]
The Commission is running a pilot on open access to research data in Horizon 2020: the Open Research Data (ORD) pilot. [...]
In 2012, the European Commission published a Recommendation on access to and preservation of scientific information encouraging all EU Member States to put publicly-funded research results in the public domain in order to strengthen science and the knowledge-based economy.
The document also asked each Member State to designate a National Point of Reference (NPR) with the task of 1) coordinating the measures listed in the Recommendation, 2) acting as an interlocutor with the Commission and 3) reporting on the follow-up. [...]
So in my understanding, everything funded directly by the EU has a mandatory open-access policy. For research funded by member States, this is only a recommendation.
See also the Open Science page on the Horizon 2020 website.
To clarify this answer: "Horizon 2020" is the name fo the portion of the EU budget dedicated to funding research from 2014 to 2020. I think one of the better-known bodies funded by Horizon 2020 is the European Research Council (ERC), but more generally all EU funds going to research go through Horizon 2020 (well, until 2020). The previous programs were called "Framework Programs" (FP, e.g. FP1, FP2, FP3... up to FP7 for the period 2007–2013).
Gold open access is the actual open access, i.e. where you pay the publisher to make it open access.
Green open access is when you or your institution make available an "author's copy" or preprint (usually the camera ready version without the copyright statement).
Green open access satisfies the EU requirements. However some publishers, especially in the case of journals, have an embargo period before which the author's copy cannot be published online in your university's repository. I think this case might require the payment of open access fees if the research was funded by the EU.
Yes, «all scientific articles in Europe must be freely accessible as of 2020» (emphasis added to the original). Not just those funded by the EU.
This was decided by the EU Council of May 2016 under the presidency of Netherlands. The Council holds legislative power together with the Parliament.
However, it's just a political decision for now. It's not a directive, let alone a regulation, so it's not directly enforced. The Commission is supposed to make legislative proposals to make it happen. This is the actual decision:
AGREES to further promote the mainstreaming of open access to scientific publications by continuing to support a transition to immediate open access as the default by 2020, using the various models possible and in a cost-effective way, without embargoes or with as short as possible embargoes, and without financial and legal barriers, taking into account the diversity in research systems and disciplines, and that open access to scientific publications should be achieved in full observance of the principle that no researcher should be prevented from publishing; INVITES the Commission, Member States and relevant stakeholders, including research funding organisations, to catalyse this transition; and STRESSES the importance of clarity in scientific publishing agreements.