I recently been told that a subpanel box that was installed in my kitchen, which previously supported an electric stove, is wired incorrectly. The subpanel takes the 240 line and splits it into two 120 20 amp lines. The problem is that the neutral line in the subpanel is connected to ground. How do I correct this? The main panel is on the other side of the house and this wire is fed through two attic spaces. I currently use this to support a convection microwave and gas stove electrical panel.
EDIT: The OP realized after reading this that she doesn't have an actual sub panel. I started answering in a comment and it was just too long. ;-)
Well... so what you really have is a 3-wire "Edison" shared-neutral circuit with a bootleg ground. The 3-wire circuit is legal, but the bootleg ground isn't. Technically, since the old wire is probably #8, the neutral is big enough to carry whatever current might end up on it without overheating and starting a fire, so that's a bit of comfort. However; you could still end up with problems. At best, the problems might be unwanted radio frequency interference in whatever you plug into those outlets. At worst, if the neutral failed (in the main panel or in the re-purposed stove outlet box), you could maybe end up with something dangerous.
You have at least two possible solutions:
1) Install GFCI outlets. Disconnect the neutral and ground wires from each other, and put the little stickers on the outlets that say "No Equipment Ground." This is safe, legal and acceptable as long as you keep in mind that some sensitive electronics might experience unwanted noise. But nothing will catch on fire and the GFCI's will protect against electrocution.
2) Run a separate ground wire back to the main panel. You could get away with pulling a single wire rather than pulling all-new 4-wire cable. In fact you could pull a bare copper wire of sufficient size as long as it's protected from mechanical damage (you can't run a bare wire in metal conduit without bonding the conduit). But you could also pick up green-insulated wire by the foot at your local box store. Don't run a ground wire in any color other than green. You could also, of course, just pull new cable. If you do that, you could pull 12/3 NM cable (with ground), or could could pull two 12/2 NM cables (with ground). If the run is really, really long (100 feet or more), maybe you'd want to pull 10/3 or 10/2, to reduce voltage drop. But #12 wire is adequate for 20A circuits.
And a caveat/warning: I presume that the original two-pole 40A breaker was replaced with a two-pole 20A breaker (and not with two independent 20A breakers, either)?
If the 40A breaker is still there, then you don't have two 20A circuits, you actually have two 40A circuits. The original wire will handle this, but the 15A or 20A receptacles that are now attached to the old circuits are not rated for 40A, and therefore the breaker will not protect those receptacles (which is illegal).
ORIGINAL: It used to be permissible only for detached structures and then only under strict conditions for a sub panel to be fed with only three wires and the grounding and neutral conductors to be bonded, but not any more. Even when it was allowed, imagine a mistake or fault running the return current through the metal panel, the metal case of your microwave, coffee maker, hand tools, your hair dryer, or any conduit between the panels, and so on.
Here's a good answer, which calls out relevant NEC sections. That answer relates to a sub panel in a detached out-building, but the same rules apply to a sub panel inside your house, except that you don't need dedicated grounding rods for a sub panel inside the same house (the panels aren't so far apart and the structure isn't so big that you have substantially different voltage potential to ground in different parts of your house).
If there aren't 4 wires in the cable between the sub panel and the main panel and you want to fix it up right, you should pull new 4 wire cable (3 conductors plus ground).
The neutral (grounded) and grounding conductors need to be isolated from each other in the sub panel.
The neutral bus will be the one(s) mounted on a plastic standoff, like the hot buses are. The neutral (grounded) bus bar is the one on your right in the first picture below, mounted on the black plastic standoffs. If there is a screw that goes through the neutral bus and into the panel itself (a metal connection from the neutral bar to the panel), it should be removed in a sub panel. The grounding bus bar is the one on your left, bonded directly to the panel housing.
In the second picture, the neutral bus is the one in the top right corner of the panel. And incidentally, the panel in the second picture is wired up incorrectly. It's obviously a sub panel, but you can see that it is only fed by three wires, and the neutral and grounding buses are electrically bonded together with a couple of white wires. To be corrected, that panel in the pictures needs a 4th wire--a ground wire going all the way back to the main panel, and the neutral and grounding buses must be disconnected.
There are different designs that accomplish the same thing. In the next two pictures you can see one method of bonding (or isolating) the neutral (grounded) and grounding buses. This would be connected (bonded) in a main panel, and disconnected in a sub panel.
So... if your sub panel was designed to be used as a sub panel, there will be some kind of disconnect for the neutral and grounding buses, or there will be a place to install an isolated neutral bus.
Of course the grounding wires and the neutral wires should be connected to their own buses separately, not mingled.
The reason for disconnecting the neutral and grounding conductors in the sub panel is to assure a low resistance path in the event of a fault, and to ensure that the neutral current never returns on the grounding conductors, which can energize the housings of appliances and electrical boxes/panels and electrocute you. In the case of a neutral failure, the ground could end up carrying all of the circuit's current, energizing the housings of your appliances, tools and the panel itself, but the circuit would continue to work without tripping the breaker.