The goal of this post is to show how to set up a small solar power generator. While there are a lot of decisions you can make, this particular how to focuses on small-scale solar generation (<1kWh/day), and simplifies it so that just about anyone can set up a functioning system. However, beware that compromises in efficiency, safety, and code adherence may be made for the sake of simplicity.
Decide how much power you need. To do so, determine which electronic devices you would like to use, then find out how much power they use. Most devices have wattage ratings, which can then be multiplied by the number of hours of use to produce "Watt-hours" (Wh), which is a unit of power consumption. For example, if you intend to use a 15W device for 2 hours a day, that's 15W x 2h = 30Wh. Note, however, that ratings are usually higher than the actual power consumption. To determine how much a device actually draws, you can use a meter like the Kill-a-Watt. Once you have all the Watt-hours, add them up. If the total exceeds 1000Wh (or 1 Kilowatt-hour), this How to may not be suitable for you.
Determine how much unobstructed sunlight you receive in the location you intend to set up solar panels. Unobstructed literally means that there are no shadows. If a tree, neighboring building, or anything else casts a shadow in that particular spot, don't count the time during which a shadow exists. So, if you get 12 hours of sunlight, but the sun is beyond the fence for 2 hours in the morning, then behind a tree for an hour at noon, then shadowed by your neighbor's barn for 2 hours before sunset, you only get to count 7 hours. Note also that days are shorter in Winter. If you intent to use your set up in Winter, use your Winter hours.
Divide your total power consumption from Step 1 by the number of hours you came up with in Step 2. If you decide you need 600Wh and that you get 6h of sunlight, that's 600Wh / 6h = 100W. This is the amount of power you need to generate per hour of sunlight to meet your needs. To be safe, multiply that by at least 2 or more. This is to account for the fact that solar panels only generate their rated output when pointed directly at the sun, and if your solar panels are fixed, they won't be facing directly at the sun most of the time. After various inefficiencies, you may lose another 20% or more of the power generated. If you expect regular and sustained cloud coverage, you may need to multiply by 5 or more (or simply reduce consumption to live within your means).
Buy solar panels. Broadly speaking, there are 3 types of solar panels (strictly speaking, photovoltaic cells): amorphous silicon, polycrystalline, and monocrystalline. Amorphous silicon panels are relatively inexpensive, relatively unaffected by small shadows, but are very inefficient in terms of space (for the same power rating, amorphous silicon panels will be larger and heavier). Polycrystalline panels are more efficient, cheaper than monocrystalline, but also less efficient. Monocrystalline panels are the most efficient, but also the most expensive. Output from mono- and polycrystalline panels can be halved or less by even a tiny shadow because of the way individual cells are wired. Mono- and poly-crystalline panels can be purchased these days can under $1 per Watt.
Consider "B-grade" panels which are significantly cheaper, yet come with reasonable warranties. While some people want their panels to last 25 years, the reality is that the cost of PV cells are coming down so rapidly that replacing or augmenting your panels in another 5-10 years may actually be cheaper than paying more now for ones that last longer. If the solar panels are more expensive than your budget allows, consider lowering your power consumption. Turning off or forgoing some devices won't kill you (and if it will, this How to is not for you).Calculate the amount of battery capacity you need. To do this, take the power consumption estimated in Step 1, then double it, because only about half the batteries' capacity should be considered usable to avoid over-discharge. Then, multiply by the number of days' reserve you would like. For instance, if you want to use 600Wh, you need 1200Wh (or 1.2kWh) of capacity, so if you had 3.6kWh, you'll be good for a few days even if the sun disappears (though you may have other problems at that point). Since most batteries have capacities in Amp-hours, it may be best to convert Wh to Ah. To do so, divide the capacity you calculated by the battery's voltage, so 3600Wh / 12V = 300Ah (divide by 6 for 6V batteries).
Buy batteries. While normal car batteries will work (for a while), it is best to use "deep-cycle" batteries, which are generally marketed for use in RVs and boats. Some people prefer 6V golf cart batteries, which are designed to withstand repeated deep discharges. If using 6V batteries, connect two in series (positive terminal of one connects to negative of the other), then connect pairs in parallel (positive of one pair with positive of the other pair, negative with negative). If your budget allows, you may consider AGM batteries, which can take more "abuse", but also cost 2-3x what lead acid batteries cost. Make sure the Ah ratings of all batteries added together is higher than the capacity you calculated in the previous step. If using multiple batteries, make sure to get multiples of the same battery, and to get them all new (or reconditioned) at the same time. Mixing different capacity, model, or age batteries can shorten all of their lifespans.
Buy a charge controller. Charge controllers can cost as little as $10 or over $100. The most important thing is to actually use a charge controller. If you hook up solar panels directly to some batteries, the batteries will charge for a while, but they could quickly be ruined. Whichever charge controller you get needs to support the amount of current your solar panels produce. Most charge controllers are rated in Amps, so divide the Watt rating of your solar panels by 12V (e.g. 200W / 12V ~= 17A). Find a charge controller with a rating higher than your theoretical estimate. This will give you a safety margin, as well as some headroom for growth in the future. Beyond that, exactly which charge controller to buy is basically a trade-off between cost vs efficiency and battery-life. The more expensive charge controllers will use different charging algorithms best suited to the type of battery you have. They also may compensate for temperature to better protect your batteries.
If you plan on running devices off of AC power (i.e. use normal wall plugs), you will also need an inverter. There are broadly two types of inverters: modified sine wave and pure sine wave. Pure sine wave inverters give you power that is closer to city power, but these inverters tend to be more expensive ($150+ for a 600W inverter). Modified sine wave inverters can be much cheaper ($30+ for a 400W inverter), but some devices may not work, or work well with them. Note also that inverters have 80-90% efficiency, which means you lose some power in the DC to AC conversion. However, if you've followed all previous steps as recommended, your set-up should have the excess capacity to absorb this inefficiency.