Why do most biplanes have their top wing slightly forward of the lower wing?
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).