Topsoil, when the term is not used in gardening centers, is a reference to (what else?) the top layer of soil of ground. Generally the first 5-10 inches are considered top soil. They tend to be mineral and nutrient dense- they are especially rich in composted organics. In other words, when plants and animals die on the ground the nutrients that made them up are added to the top most layer of soil. It's then used by plants that grow, which die or are eaten and so on.
Topsoil, when you're talking about the bagged kind at gardening centers, is generally dark soil with minerals or organic nutrients added to make things grow better in your garden. It is, to be clear, not potting soil. Potting soil is specifically designed for plants that grow in pots (and often isn't even actually soil, using other materials that are ideal for potted plant growth), though it may also have added minerals or nutrients.
Now, if you're gardening on the ground, you may be wondering why you would need to buy topsoil? After all, the ground already has topsoil, doesn't it?
Well, yes, technically. But because in most cases what the topsoil has had growing on it was grass, which isn't putting a lot into the system in most cases. Also, the grass doesn't often die onto the lawn. Sure, if you have been mulching your lawn clippings there may be some turnover that way, but if you've been bagging them... the grass revives in the spring, right? You don't have to keep replanting. So it's likely that the topsoil you already have could use some help.
So, what, you just throw a bag of topsoil on top of the ground?
Er, no. You see, because the ground is probably a bit compacted, if you just throw topsoil on top of it, wherever you're planning to garden, you're going to run into issues. Drainage issues, probably. Also the roots probably won't go much deeper than the topsoil you add, which is just... not what you want to do. Best practice is to till up the area you want to garden, add your top soil (generally three inches, though that depends) and then till it again. That sounds like a lot of work, but you'll save yourself a lot of headaches in the long run.
As far as what kind of topsoil you need, that decision is going to be based on what you're growing, what the soil is already like, if you've done any soil conditioning in the past (like adding compost) and so on.