I am a non-expert bike rider. I keep my bike in a closed storage during the winter and ride during the summer. Do I need to do some kind of maintenance at the beginning of each summer? Is it safe to start riding directly when the summer begins?
Have it looked over once decade, whether it needs it or not.
Otherwise, if nothing's giving you trouble, all you need to do is to air up the tires and put some chain oil (buy "dry" chain oil from a bike store) on your chain once or twice a season.
Assuming this is a multi-speed bike, to oil, first hold a rag on the chain and crank backwards to wipe off as much surface grime as possible. Also wipe off the derailers. Then slowly crank backwards while dribbling oil onto the chain. Go over it 2-3 times. Then wipe the chain again -- you only need oil on the INSIDE of the chain. Finally, put a few drops of oil on the derailer idler pulley bearings and on the derailer pivots, and, again, wipe off any excess.
An occasional squirt of spray lube (eg, TriFlow) into the shifter/brake cable housings is also a good idea.
Be sure to check your air pressure at least every 3 days, or before each ride if longer. It's a good idea to get a "floor pump" with a built-in pressure gauge -- much easier to use than compact pumps, and you'll not be so inclined to put it off as you would if you just use the gas station pump.
I have bikes that stay some months without being used, just leaning against the wall (behing more bikes which are much more used.
Each time I want to use them, I just go up and ride.
This has giving me no problems.
I believe the right thing to do is to perform maintainence as needed. If there is nothing wrong with the bike when you store the bike, and nothing feels (or looks, or sounds) wrong, so there is no need to worry.
Based on my experience, the best maintenance is to clean and inspect the bike after each use, specially mountain bikers, depending on the type of cycling you do, the distances, the trail condition and the weather. Commuters and road bikers can loosen their cleaning schedule if they ride clean roads/streets in good condition.
After cleaning the bike, inspect closely brake pads, cables, handles levers and shifters, rims, tires and pivots, chain, gears and derailleurs, if any. Do not forget suspension parts if your bike has them. If you have racks, fenders, lights or some other, give it a check too.
Look for loosen bolts and nuts, abnormal wear or normal wear beyond normal limits (specially brake pads). Tighten anything that needs to, and if necessary, perform a deeper cleaning in particular items (like derailleurs).
Finally but most important of all, apply lubricant in all the relevant points, preferably after the bike has dried. The minimum you should do is lube the chain and derailleur pivots.
Performing this check every time allows you to detect when something goes wrong and needs special attention, replacing or service at a bike shop before a catastrophic fault occurs. Once you have established the habit, you'll learn how to perform the check faster. This also allows you to plan ahead for buying replacements or upgrades so you don't have to do emergency buys or risking your store is "out of stock" at a critical moment (keeping you from a race or special event for example). This can lower your maintenance bill since you can buy items when there are special offers, instead of buying what you find at the price you find.
Remember to clean before the inspection, so mud an debris don't fool your sight. Dirt can hide cracks or disguise abnormal wear.
Performing this after the ride and not before it, gives you time to react, you can plan when to perform reparations or take the bike for service, if you leave it for just before the ride, chances are you might have to cancel or may get a major delay.
If (like me) you use your bike in a lot of muddy trails, you MUST clean the bike on a per ride basis. Make sure you do not leave stuck mud to dry in your bike. The humidity will cause corrosion, and some kinds of mud can degrade paint or tire rubber if left to dry in the bike. If you ride cleaner trails, you can skip cleaning or keep it just for critical items (crankset, chain, sprockets and derailleurs).
Doing this can extend the time between services at the shop and lengthen lifespan of bike components. Nonetheless keep in mind:
New bikes may include in its price some first checks at the bikeshop, or they may be mandatory to keep the warranty.
Complex items like Suspension forks or shocks need to be serviced by specially trained mechanics on a distance ridden basis or on a fixed time basis, regardless of external good condition appearance. (Some forks for example use special oils that mus be changed because they degrade over time, even if not ridden).
In case of a bike that has been properly stored for a while, at least the check must be performed, preferably a week or so before the first planned ride, for the reasons mentioned before. The cleaning and checking should both be performed before storing the bike for long seasons.