Items can either be purchased directly for gold, or for a combination of gold and lesser items that are used as components. A recipe is the set of items that are needed to turn in to buy a greater item, which generally combines all of the stats of the lesser items, and adds a bonus on top of that. Essentially, in exchange for a bit of extra gold you get to collapse all of those items into a single slot and get a significant bonus on top of that.
In DoTA, purchasing an item through a recipe required that you have already purchased the items that you need to sacrifice as components. In LoL, the process is somewhat simplified, as long as you have the total cash needed for the product of a recipe, the shop will let you skip on the purchase of the components, and just build the price of the components you don't yet have into the total you have to pay for the product. This allows you to purchase the product of a recipe even if you don't have enough slots to hold all of the components.
In general, you want to plan in advance which of the recipe items you want to work towards, and buy the components as you can afford them. This way, you can get part of the benefits of the final item and only have to pay part of the price at that time. As you build up the components in your inventory, the price for the final combine will get increasingly cheaper, to the point where you can just buy it outright without needing to save up your money too much. There's no disadvantage whatsoever to buying subcomponents early on, as long of course as you don't use up gold that you would have spent working on a different combine.
Once you've purchased the product of a recipe, the components are gone forever, and if you want them back, you'll have to buy them from scratch. The product is generally worth much more to you than the availability of the components, though, so I wouldn't worry at all about that for a while. Just bear in mind that if you spend components on mid-tier items like the ones that give you gold over time, they won't be available for more expensive items that you'll want for the endgame.