The property that determines how well magnetic recording materials (or any other magnets) will retain their magnetization is called coercivity. Often the value is given on the cassette or on an information sheet accompanying the tape or disk. The unit officially used for magnetic fields nowadays is the tesla, although the gauss is still used. One tesla is equivalent to ten thousand gauss, and the earth's magnetic field is about half a gauss. Most magnetic recording materials have coercivities from several hundred to a couple of thousand gauss. That means they will retain their data unless they are exposed to a magnetic field greater than their coercivity, i.e., to a field greater than several hundred gauss.
Most industrial magnets (as in motors and speakers) and some strong refrigerator magnets produce magnetic fields stronger than this in their immediate vicinity, so tapes and disks should be kept away from them. But the magnetic fields fall off very rapidly with distance from the magnets, and only a very large and strong magnet will produce fields greater than several hundred gauss more than an inch away. And the external magnetic fields produced by household appliances are usually much smaller than a gauss.
Since the magnetic fields produced by magnets depend on their size and shape, on the specific magnetic material used, and on their detailed pattern of magnetization, and because different recording materials have different coercivities, you can't develop simple rules about safe distances that will apply in all cases. However, except for large and strong magnets, an inch or two separation will be quite safe. You might find my book Driving Force: The Natural Magic of Magnets a good place to start to improve your understanding about magnets and recording materials, magnetic fields and coercivities. There are many other introductory books on magnetism that might help. There are also several handbooks on magnetic recording that provide lots of detailed data on coercivities of various recording materials. Digital data will often be a bit more resistant to distortion or erasure than analog data, but the most important thing is not the form of the data storage, but the material used and its coercivity, which directly measures its resistance to demagnetization.