Everybody wants an greater range and accuracy in their weapons. The facts are these:
Accuracy is entirely determined by the quality and weight of your BB (heaver is more accurate), barrel quality, and your hop-up (consistency in back-spin imparted). That's it.
Range is determined by the FPS your weapon is capable of generating, hop up set up, and the weight of the BB. That's it.
So increasing FPS is the key modification you can make to both increase your range and allow you to use heavier BB's to improve accuracy. Increasing FPS, is the most common reason for people to open their gearbox (other than repair). Your spring determines your FPS. All other modifications and upgrades merely modify your springs output. Period. The motor merely compresses the spring. It's the release of the spring which drives the piston in into the cylinder and compresses the air through the nozzle and barrel which sends your BB flying.
To increase FPS you can do any of the following:
Add a tightbore barre 6.04mm (or smaller)=5-10fps
Fix leaks=5-30fps
Change spring=50-200fps
Longer barrel=~1-2 fps per inch
Bore up Kit=~10fps
With any of these upgrades, your actual results will vary. Everybody's AEG is slightly different. So putting the exact same spring in one guys M4 will yield different results than another guys M4 or another guys G36. So take these FPS numbers with a grain of salt.
Fix Leaks
This may seem like a no-brainer and mundane task but it's often the hardest to accomplish. Leaks occur in many points in your gearbox such as the piston o-ring, cylinder o-rings, nozzle, hop-up unit, or hop-up bucking. Be sure when you're working on your gearbox that you inspect the quality of all those seals. Simply replacing your piston O-rings when they're worn can improve your FPS by 20%. And you can buy a variety pack of good quality plumbing O-rings from any hardware store for less than $5.
Tightbore Upgrade
Replacing your stock inner barrel (typically 6.08mm wide) with a tightbore (typically 6.04-6.01mm wide) increases your FPS because it reduces the space between your BB (which is actually less than 6mm wide) and the inside of the barrel. Less space, means more air is stuck behind the BB pushing it forward out the barrel.
Upgrading your Spring
This is the most common means of drastically increasing your FPS. Your gun's FPS is almost entirely governed by the strength/hardness/elasticity of your spring. The spring pushes the piston in to the cylinder, compressing the air which pushes your BB through the barrel and out the gun. Your motor simply compress the spring.
The maximum strength spring you can put into your gearbox depends entirely on the parts which make up the gearbox. In a stock Tokyo Marui gearbox, the hardest spring you would want to put in is a Systema M110/PDI-150. The stock motor and gears in a TM would have a difficult time with a M120/PDI-170 spring (or may not be able to compress it at all.) For most players a gun that fires from 300-350 fps is more than sufficient for most airsoft games.
Systema springs are more common but PDI springs are softer and gentler to the gearbox. All springs 'break in' after initial use and their FPS lower slightly. PDI springs are in a sense pre-broken in. Be advised that they are slightly thicker than Systema springs and may not fit with certain pistons.
Springs Needed for Approximate FPS
340-360fps you will need a M110/PDI-150 spring
370-390fps you will need a M120/PDI-190 spring
400-430fps you will need a M130/PDI-210 spring (this is ~400fps with .25g BB's)
430-460fps you will need a M140 spring*
460-500fps you will need a M150 spring*
*These are only allowed for use in semi-only rifles
Steel Gears, Bushings, Shims
With M120/PDI-170 or harder springs, you will be putting increased pressure and strain on your gears. TM and older clone gears are too soft and will likely strip or fail. This is why they need to replace with high strength steel gears and metal bushings. Newer vintage clones (since 2007) come with these upgraded gears pre-installed.
Bushings are the circular bearings that fit your gears to your gearbox walls. You will need to shim these new gears properly or you risk stripping them or causing friction which damange them and will rob you of FPS, battery life and ROF. Shims are washer-like spacers that let you micro-adjust the height of each gear relative to each other.
Hi-Torque Motors
Unless you have an ICS, KWA or other pre-upgraded AEG's, you will likely need to buy a high-torque motor such as those made by Systema, Hammer, Guarder. As motors age, they lose strength and torque. Stronger motors are generally more efficient but the harder strain of an upgrade spring also means that you'll be using up your battery faster.
Torque Up Gearsets
If you don't want to replace your motor (or your spring is so strong that even an upgrade motor isn't enough), a Torque-up gearset functions like a car's transmission, changing the gear teeth ratio to increase torque output by lowering your ROF (slightly).
Spring Guide
With a harder spring you will also need a metal spring guide, ideally with a bearing. The spring guide is a peg that holds your spring in place within the gearbox. The bearing on the spring guide and inside the piston allows the spring to rotate freely as it compresses and decompresses.
Piston/Pistonhead
Higher strength springs put more pressure on the piston and pistonhead. You'll want to buy a reinforced piston that with teeth that will resist stripping (some come with metal teeth or partial metal teeth). You'll also want to buy a reinforced pistonhead that can withstand the repeated harder impact.
Some choose metal heads but reinforced polycarbonate pistonheads and pistons are more than durable enough for 400fps springs and have the added benefit of being lighter, less draining on your battery and quieter when firing.
Longer Barrels
In theory, the longer your barrel, the longer your BB is under pressure and the higher your potential FPS. But the increase in FPS is relatively small (only about 1fps per extra inch in extended length). The exact numbers a little sketchy because when folks install longer barrels they tend to be tightbores too. If you are installing an inner barrel that is longer than 509mm long you may want to install a bore-up cylinder set to offset the larger volume of air in the barrel.
Bore Up Cylinder Kit
The more air you have pushing the BB, the faster it will go. A bore up has a larger diameter air nozzle and thus you need to replace your cylinder head, piston and pistonhead. But this performance increase is only marginal with short barreled AEG's (those under 300mm long) and AEG's with sub 400fps springs. This is the least cost-effective FPS improvement.
LPEGs and Early Clones
Some low grade clone AEG's and older versions had very low quality internal parts. Upgrading them is ill advised as the parts are weak and break under the strain of a +350fps spring. Do not put an upgrade spring in a plastic gearbox. It will not last past a couple of shots if at all. Of the new generation of 'clones' I can only recommend JG (Jing Gong)/Echo-1 gearboxes for upgrading.
The new baseline: 350fps
Originally airsoft guns were made for the Asian market with 300fps limits. For the US market, since 2006 most Clone AEG's have been pre-upgraded with M110 class or M120 class springs and reinforced internals to handle them. Since 2008 it's become surprisingly common to see AEG's shooting +400fps out of the box.
So in some cases you may not need to modify your AEG at all, at least until your spring weakens over time (they all do.)
Barrel Lapping
Barrel lapping has become popular the past couple years, and is sometimes better then buying a new barrel. Lapping a barrel means you are taking out the inconsistencies inside the barrel. Even higher quality barrels are not perfect, but lapping can help get it close to being perfect. Now are the days that a new, higher quality barrel may not be necessary. If you have a brass barrel, you can lap said barrel, and make it better then an aftermarket barrel.
Final Words of Advice
Upgrading your AEG is a lot like going to the Dark Side of the Force. It is very alluring and sexy and a seemingly easy path to more kills. Upgraded AEG's can require more maintenance, and can be more prone to catastrophic breakages. Often to change one part you need to change 5 others. Once you go down the path of of the Dark Side, the costs increase exponentially.
Remember, it's not the FPS of the AEG but the quality of the player that gets kills. And may the Force be with you.