Placing the top wing ahead of the bottom wing in biplanes is called (positive) stagger.
It is mostly used in small biplanes and improves pilot vision.
In order to accommodate a variation of pilot weights and to reduce accelerations in maneuvers, it is advisable to place the pilot very close to the center of gravity.
If the upper wing were in the same lengthwise location, it would obstruct the forward and upward vision of the pilot.
Why is upward vision so important?
Because of the bank angle, in turns you need to look up in order to see what is ahead.
A high mounted wing right at the center of gravity would rob the pilot of forward vision in turns.
Therefore, in small biplanes the top wing is moved forward while the bottom wing is moved back correspondingly, so lift is created close to the center of gravity, but the top wing is out of the way.
Large biplanes do not need this arrangement because the pilot sits ahead of the wing.
The Antonov 2 below is an example ( source ):
In many designs, the center wing has a cutout at the rear in order to give the pilot a better field of view.
Even more interesting is what had to be done to improve pilot vision in parasol monoplanes.
The Focke-Wulf 56 used slight wing sweep in combination with a reduced root chord in order to reduce the obstruction to the pilot's field of view of the rear wing center (picture source ).
aviation.stackexchange.com/users/1961/Peter Kämpf
It's called a staggered wing and is done to reduce aerodynamic interference between wings in certain circumstances.
A wing with positive (forward) stagger is most common because it improves both downward visibility and ease of cockpit access for open cockpit biplanes.
aviation.stackexchange.com/users/28200/MadMarky
Wing efficiency.
Here is an analysis of biplane wing efficiency relative to separation as a percent of chord.
The reference states that positive stagger (upper wing ahead of lower) by 0.4 chord gives 5% better efficiency, so advancing the upper wing 0.4 chord would be beneficial compared to the vertical stacking shown.
aviation.stackexchange.com/users/30468/Pilothead
In the case of the agricultural plane, pictured, the stagger increases the nominal CG range, a bit.
Finally, the upper wing will have a slightly greater angle of incidence, enhancing its stall and stall recovery characteristics.
aviation.stackexchange.com/users/31335/Walker
Remember that a wing works by having high pressure below it and low pressure above it.
So, looking at the top wing, it has low pressure above it - OK.
And it has high pressure below it, BUT... that high pressure is then affected by the low pressure of the bottom wing.
Now looking at the bottom wing: it has high pressure below it - OK.
It has low pressure above it, but that is affected by the high pressure below the upper wing.
So the high/low pressure areas of the two wings interfere with each other if they're mounted vertically above each other.
But if you move one wing foreward or aft of the vertical, then the high/low pressure areas affect each other less.
You can move the top wing forward, which is normal.
Or you can move the top wing backwards as on the Beech Staggerwing.
Either way works.
aviation.stackexchange.com/users/25728/RAC
In most of the biplanes, the top wing is located a little forward of the lower wing. What is the use of this? Also, how does this affect stability of the aircraft.
Why do most biplanes have their top wing slightly forward of the lower wing?
aviation.stackexchange.com
<aircraft-design><aerodynamics><stability><biplane>
aviation.stackexchange.com/questions/53379
aviation.stackexchange.com/users/26285/Vinodh Raaj
The top wing is forward of the bottom wing for wing efficiency. It's called a  staggered wing  and is done to reduce aerodynamic interference between wings in certain circumstances. A wing with positive (forward) stagger is most common because it improves both downward visibility and ease of cockpit access for open cockpit biplanes. Finally, the upper wing will have a slightly greater angle of incidence, enhancing its stall and stall recovery characteristics. The slightly forward position of the top wing location is explained because of its usefulness to dicrease aerodynamic accelerations and to impove the efficiency if the wings, because of the improvement of visibility and cockprit access that it offers and the enhancement of stall recovery. Finally, the desired lift of the biplane comes from its center and this offers greater safety. 
It is useful so as to dicrease aerodynamic accelerations and to impove the efficiency if the wings.  The desired lift of the biplane comes from its center in a safer way.  Improvement of visibility and cockprit access.  Enhancement of stall recovery. 