The increases will take effect on March 31, two years after the last increase in stamp prices. The privatised Royal Mail said it had "thought carefully" about the impact on customers before making the decision.
It said that, under the regulatory framework, it could have increased second class stamps to 57p and that its prices were among the best value in Europe, where the average for a first class letter is 67p and 60p for second class.
Stephen Agar, its managing director of consumer and network access, said: "We understand that nobody likes to pay more, especially in the current economic climate. We have the highest service specification of any major European country."
A large letter first class stamp up to 100g will rise by 3p to 93p. A large second class stamp will rise 4p to 73p.
Robert Hammond of consumer group Consumer Futures said: "This is a significant increase in the price of an essential service and those consumers who use it will look much harder at the value for money and quality of service. Royal Mail needs to modernise, but customers are being asked to pick up the tab."
John Allan, chairman of the Federation of Small Businesses, said: "Businesses will be looking to Royal Mail achieving their delivery and service performance targets, and for Ofcom to use their powers to fine should they not be met."
Consumer Futures said the 3% rise in first class and 5% increase in second class prices were above the current inflation rate of 1.9%. It added that since 2009, prices have increased by 59% for first class and 77% for second class.