You need at least two goats so that they can keep each other company, but it's better to start slow. And you need to get only wethers (castrated male) or does, depending on your purpose, unless you have seriously considered the implications of getting a buck and decided that you really need one.
Basically, it's important not to get too goat-happy too soon. The number of goats you can adequately provide space for on your property depends on the answers to a few questions:
How much fenced pasture or range is available to the goats?
If you live in an area where you can't let your goats range (roam over a large area), such as a desert area or in the city, you need about 20 square feet per adult standard-sized goat for sleeping and resting, plus another 30 square feet (outdoors, ideally) for exercise. This gives them enough space to move around and not be cramped or too confined.
If you have a larger outdoor area in which to raise your goats — where they'll have pasture, woods, or range — you need less indoor space per goat because they only rest and sleep there. The rule of thumb is 10 to 15 square feet per adult standard-sized goat.
How much space do you have for a sleeping area?
Goats like to sleep together in small groups (slumber party!), and so the actual sleeping area they need can be quite a bit smaller than their living area. If you have a building with a lot of separate pens, keep the doors open so they are accessible to all of your goats. (Of course, the herd queen and her brood will take over the best spot anyway.)
Will they have kids?
A standard-sized goat needs at least a 4-foot-by-5-foot kidding pen. If you have more than one doe that you want to have kid, breed them at different times, and clean and sanitize the pen between kiddings.