What is the name of the following plant?
Is it a kind of cactus?
That is indeed a member of the aloe family. As others have said, there are hundreds of types. A good list is provided here. I don't know enough to narrow it down. A Google search brings up pictures which may be helpful. This site about identification, care, and uses for aloe has a picture that looks similar to yours.
Aloe is easy to care for, and can live a long time as a houseplant. It's also happy in a pot outside, as long as you monitor the temperature. A few are hardy to −6.7 °C (20 °F) (hardiness zone 9), but in general temperatures above freezing are your best chance for success. On the other end of the spectrum, it will become brown and wilted in temperatures over 100°F, (38°C), so take it out of the hot sun at the height of the summer.
It can be planted in the ground, but unless you live in ideal outdoor conditions, keeping it in a pot tends to be easier. That way you can move it around over the course of the year, and bring it inside when necessary. However, if you'd rather have it as part of your landscape, it will transplant easily back to a pot for the winter.
Aloe has shallow roots, so deep pots aren't necessary, but good drainage is essential. Special soil isn't required, but if you do buy a potting soil, choose a mixture made specifically for cactus and succulents.
Water it infrequently, and only when the soil has almost completely dried out. If it's outside, sometimes the rain is enough to keep it going for a month or so.
Indoors, look for an area near a window that will provide six to eight hours of bright, but not direct, sunlight. If you don't have an ideal spot, supplementing with grow-lights can be helpful.
As for whether or not it's a cactus, I don't think so. This site has a good list of plants that are commonly mistaken for cactus, but technically aren't. The aloe is listed as one of those.
Additional Sources: