A similar principle is used in pumped storage hydroelectric power stations, the difference being that the mass is in liquid form. These have two reservoirs at different heights. When demand for electricity is peaking, the turbines run normally as the water goes from the top reservoir to the bottom one. When demand is low, the turbines are reversed (essentially becoming pumps), and the water is returned to the top reservoir.
Potential problems with your idea are that you'd need either an absolutely enormous mass, or an absolutely enormous height over which it can fall. Both of these scenarios have their own engineering difficulties to address, as I'm sure you can imagine. For a large energy storage capacity, you'd likely be talking extremely high numbers for things like tension in the rope, which would itself have some notable safety issues.