It all depends on the size of the aquarium. Regardless of the tank size, it's important to have solid support based not only on the tank size but the filled weight of the aquarium. The biggest error made by aquarium owners is underestimating the weight of the tank once it is filled with water.
An empty twenty-gallon glass aquarium weighs over twenty-five pounds, while an acrylic tank weighs half that. Regardless of the material the tank is made of, the real problem comes into play when it is filled with water.
Water is Heavy
Water is a weighty material, adding over eight pounds per gallon to your aquarium. In addition to the water, you'll be adding substrate for the bottom, which is also heavy. The weight of a twenty-gallon glass tank soars from twenty-five pounds to well over two hundred pounds when it is filled with water and gravel. Needless to say, that little bookcase against the wall is probably not a good candidate as an aquarium stand for anything other than a mini tank.
Full Bottom Support
Weight is not the only issue when selecting a supporting structure for your aquarium. Different aquarium materials require different types of support and should be taken into account when choosing a stand.
Acrylic has the advantage of being lighter weight, but because it is flexible it requires support along the entire bottom surface of the tank. Meanwhile, glass is heavier, but will not buckle. For that reason, a glass tank only requires support on the outside edges of the aquarium. That said, when working with a very large tank, full support is wise for any type of aquarium.
When choosing a stand, keep those differences in mind and purchase the appropriate type of support.
Another factor to consider is the importance of the tank being level and supported evenly. If one edge of the tank overhangs the stand, or the entire tank is not level, additional stress will be focused on a specific seam. Over time the extra pressure can cause that seam to fail, resulting in leaks. Always ensure that the tank is level and that no portion of the tank overhangs the support.
In addition to the issue of weight and bottom support, consider the need to access equipment in and around the aquarium. If a shelf, desk, or bookcase is used, keep in mind that you'll need to have some clearance space behind the tank for cords, filters, etc. If a canister or other external equipment is used, there must be space for it close to the aquarium. A stand usually has space built in below the aquarium itself, which can be used to conceal equipment and store accessory items.
As a general rule of thumb, tanks under twenty gallons can be placed on a sturdy desk or a well secured solid shelf. When setting up aquariums larger than that, it is advisable to consider a dedicated aquarium stand.