Castrogiovanni capped his first season at the club by being named Guinness Premiership Player of the Year in 2006/07, while Ayerza has already made nearly 40 appearances for the club since his move from Argentina in the summer of 2006.
Both played a significant part in taking Tigers to three major finals last season and have continued their good form in the current campaign following World Cup commitments.
Tigers head coach Marcelo Loffreda said: “We believe Martin and Marcos are among the best young props around and we are delighted that they are happy to stay with Leicester Tigers.
“They have worked very hard in their time with this club, they have trained and played well, and they are also popular members of the squad.
“I am sure they will both continue to improve their game here, and they will develop as top-quality players at this club.”
The 26-year-old Castrogiovanni, signed from Italian club Calvisano, said: “I am enjoying my time at Leicester Tigers and when you are happy it makes the decision easier to stay.
“There is an excellent squad of players here and the supporters have been great to me since I arrived. Those things helped to make me very happy to agree a new contract.”
Ayerza exchanged club rugby in Argentina for a professional contract at Leicester and was also delighted to extend his stay.
The 25-year-old Ayerza said: “It was a big change for me coming here last year but for my rugby career Leicester Tigers is a great place to be.
“I have learned a lot from top international players and the coaches here and I am looking forward now to improving more in the next three years with the club.”
Forwards coach Richard Cockerill added: “Castro and Marcos are two young guys of Test quality and, although they are from overseas, they are now very much Leicester boys.”