You can keep gravy for up to 4 days in the refrigerator.
After 4 days of the gravy being in the refrigerator the gravy will start growing bacteria and will start turning bad.
If the gravy as meat in the gravy then it will start spoiling even sooner and may only last as long as 3 days in the refrigerator.
So if you're refrigerating the gravy make sure to eat it within 3 to 4 days before it has time to go bad.
If you need to keep your gravy longer than 3 to 4 days you should freeze it instead.
You can place the gravy into Ziploc bags, Freezer Bags or even freezer safe containers and freeze the gravy to make it last longer.
When frozen the frozen gravy will last for 6 months before it loses it's freshness.
Although the gravy will remain safe to eat for up to a year and sometimes longer as long as the gravy as remained frozen.