At just 21 years of age, he has already played 52 times for Ulster and has been top try scorer for his native province in each of the past two seasons.
His try against Munster in the Heineken Cup quarter-final last season saw him chosen as the Try of the Year winner at the 2012 IRUPA Player Awards.
He scored two tries for an Ireland XV against the Barbarians in May and three tries for Ireland in last Saturday's non-cap international against Fiji at Thomond Park.
Gilroy was educated at Methodist College before playing club rugby with Dungannon. He has played for Ireland at Schools level and was also part of the Ireland Under-20 side that competed in the 2011 IRB Junior World Championships.
"Things are going really well at the moment. We have had a good start to both the RaboDirect PRO12 and the Heineken Cup and it is great to be part of it.
"I am looking forward to helping Ulster be successful over the course of the rest of this season and the next three seasons."
Ulster's director of rugby David Humphreys commented: "I am pleased that a player of the talent of Craig Gilroy has committed to Ulster for the long term.
"Craig is a product of the Ulster Academy and he fits with our ambition of creating a team of home-grown players capable of competing with the best in Europe.
"There is no doubt that he is an exceptional rugby player and his future both at provincial and international level is extremely bright."