Mushrooms when kept in the fridge will last for 3 to 4 days.
After 4 days the mushrooms will start going bad and should be thrown out as they can grow bad bacteria.
If you notice a bad smell to the mushrooms or they are getting slimy or have changed color then throw them out as they have gone bad.
You can freeze mushrooms and they will last longer.
When frozen the mushrooms will last for up to 6 months before they go bad.
I will sometimes freeze mushrooms to use later in soups and stews or in baking and they've lasted up to 6 months in the freezer.
The freezing temperatures of the freezer prevents bacteria from growing on the mushrooms and other food so they last longer.
You can put the mushrooms into a freezer safe container or Ziploc bags or freezer bags.