There's really no hard or fast rule to how long you can keep mushrooms in the fridge. Frankly, you can keep them in the fridge for as long as they remain fresh - lol!!
That said, so long as they're kept dry, they should last quite awhile, although they may begin drying out a bit. Even then you can still cook with them. As others have already stated, once they start turning dark &/or slimy it's time to toss them. A bit of dryness, particularly if you plan to saute them or cook them in liquid, won't hurt them a bit, & even concentrates the flavor.
I currently have half an 8 oz. package of white button mushrooms that've been in the fridge for almost 2 weeks now & will be using them tonight. They're in the usual pressed paper plastic-covered carton, but I loosened the plastic to allow air to circulate & they're just fine. I've also found that out of all the fresh mushroom varieties commercially available, Shitakes definitely last the longest. I've been amazed at how long a container of fresh Shitakes - again, with a bit of air circulation - remains fresh & usable.