The deal between the Communication Workers Union and the recently-privatised company, which has averted strikes, covers over 130,000 employees.
Royal Mail said the agreement was believed to be the first of its kind in the UK, giving legal protections that benefit workers and the company.
Workers will receive a 3% pay rise, backdated to April, 3% from next April and 2.8% from April 2015, as well as a £200 lump sum paid before this Christmas.
Royal Mail has committed not to introduce zero hours contracts, will deliver future changes without compulsory redundancies, will make higher contributions to the pension scheme and will not undertake any additional franchising.
CWU deputy general secretary Dave Ward said: "The agreement breaks new ground in the UK by incorporating extensive legally binding protections for employees alongside a commitment to improve industrial stability.
"The legal protections for Royal Mail employees come hard on the heels of the privatisation of the company and are unprecedented in delivering the strongest protections for employees.
This is a good deal for the company and customers as well as for employees, but investors should be clear that this agreement commits them to growth and there will be no tolerance to a race to the bottom on services and jobs."
Moya Greene, chief executive of Royal Mail, said: "I am delighted that we have reached an agreement in principle with the CWU. This will provide long term stability and certainty for Royal Mail. CWU members will vote on the agreementnext month.