Not every tree that is planted requires staking. Trees only need to be staked when their top portion of the tree significantly outweighs the rootball, and when the tree is planted in areas where it will be exposed to high winds. Staking can help to keep the tree standing up straight until it has developed a root system strong enough to hold itself up on its own.
There are several methods for staking a tree. I'll warn about the method not to use and, then, provide instructions for the method I like to use.
How Not To Stake A Tree
I would heavily recommend not using the method in which a single stake is driven vertically into the ground, just beside the trunk of the tree, and then tied every foot or so up the trunk. This type of staking will not provide adequate support against wind. It will also not allow the tree to develop a strong trunk that can stand on its own. In fact, when a tree is staked this way it causes the trunk to become very weak. When the stake is removed a year or so later the trunk of the tree will often bend over to the ground as if it were flexible rubber.
The Stake & Wire Method
This is the tree staking method I have used for years. When done correctly, it usually offers very good support for small to medium sized trees and allows the tree to develop a strong trunk while it is rooting in and establishing itself.
STEP 1: Marking For Stakes
First measure the height of the tree. Then mark three or four spots on the ground at a distance from the trunk that is equal to half the height of the tree. For example, if the tree is 10 feet tall, mark the spots 5 feet away from the trunk and equally spaced around the tree.
STEP 2: Setting The Stakes
Then, at each marked spot, drive an 18 to 24 inch long wooden stake (1' x 2" or 2" x 2") in the ground at a 45 degree angle and to a depth where there's about 3 or 4 inches of the stake still above the ground. The stake will need to be driven into undisturbed solid ground - not the soft backfill soil used when planting the tree. The stake will be easier to drive in the ground if it has a pointed tip. You can use a saw to make the points or purchase them already pointed. The stakes should have a hole drilled in the top center of the stake, or a notch cut out on one side towards the top of the stake. Drive the stakes in the ground at an angle away from the trunk. You can purchase tree staking kits for this purpose but most come with 3 stakes rather than 4. Larger trees and palms might require 4 stakes.
STEP 3: Securing With Wire
After driving the stakes in the ground you will use a metal wire or very strong nylon cord to tie from the stake to the trunk of the tree. First, just above the first branch or at a point at least half way up the height of the tree, tie one end of the wire around the trunk of the tree. It's best to tie the wire just above a branch so that it cannot slip down the trunk. When tying the wire or chord around the trunk of the tree, run it through a piece of rubber hosing that will wrap around the trunk. I cut and use a piece of garden hose for this purpose, but any rubber hosing will work fine. The hose will keep the wire or chord from cutting through or damaging the trunk of the tree. Then, after you have tied and secured the wire to the trunk of the tree, run the other end of the wire through the hole or around the notch in the top of the stake you drove into the ground. As you tie the wire or chord to the stake, if necessary, pull back gently on the wire to correct the lean of the tree. When you have the wire or chord tight and the trunk is standing straight, twist or tie the wire or chord to secure to the stake. Repeat this process for each stake.
When To Remove The Stakes
The stakes are used to hold the tree up straight while it is developing a root system and establishing itself. Trees planted and staked in spring will usually root in well within the first season however, to be on the safe side, don't remove the stakes until after the following spring or until you know the tree has established itself well enough to stand straight on its own. Trees planted and staked in fall can usually have their stakes removed at the end of the next fall season.