Renting an apartment requires that you must check with the landlord when it comes to changing things, whether they are cosmetic or functional. If your kitchen has a large gap between the gas stove and the back wall, it could cause several issues. A gap in that space is common because the gas line often forces the stove away from the wall. Because you don't own the apartment, your options are limited in what you can do to eliminate the gap. Often, it depends on whether or not your landlord views the gap as a problem.
Gas lines generally come out of the floor or wall and extend several inches out from the wall or up from the floor. Gas stoves have recessed areas in the back that should fit around the gas line, leaving only a 1-inch gap to avoid crimping the line. This lets the stove sit fairly close against the back wall. If you get a new stove to fit into the same place, the recessed area may not match up like the old one did, causing a large gap of several inches between the stove and the back wall. If you are trying to install your own gas range, the landlord may not care about the problem. If the new range is provided, the landlord may be more concerned about the gap.
Call a Plumber
A plumber can reroute the gas line so that it fits the new gas stove. Depending on how the system is set up, it may be as simple as adding a few more pieces to turn the line as soon as it emerges from the floor or wall. In more complex jobs, the plumber may have to get under the floor to make the changes. In a rental unit, there likely are restrictions in your contract about making any changes of this nature without permission. Some landlords work exclusively with one plumber or plumbing company and won't allow outside work. As a renter, you'll have to work with your landlord to solve the problem of a gas stove that leaves a gap between it and the wall.
Check with your landlord about making the adjustment. Because the appliance isn't broken, rerouting the gas line would not fall under the rental agreement as a mandatory repair. Remind the landlord about the inconvenience of having a gap behind the gas stove, especially regarding hygiene or pest issues with food falling out of reach. Point out any safety issues that may arise over the out-of-place stove, like tripping. Aesthetically, a gap between the stove and the wall can make the kitchen look sloppy and poorly designed, something that many landlords don't want to promote in their rental units. Give the landlord plenty of good reasons to invest in dealing with the gap between the stove and the wall. The landlord may agree to call a plumber to reroute the gas line to accommodate the new gas stove.
If the landlord refuses to allow a plumbing fix, there are some cosmetic solutions that will cover the gap between the gas range and the wall. Whatever you do, ensure that you will be able to restore the rental unit to its original condition. Check with the manufacturer to see if there is a stovetop extender, a piece of matching metal that fits on the back of the unit and bridges the gap between it and the wall. If not, purchase a generic stovetop extender, an L-shaped piece of metal or vinyl that attaches to the back of the stove and covers the gap. It may be magnetic or might fit into existing screw holes in the back. These can be removed when it's time to move. Or, cut a piece of wood to fit the gap exactly and affix it to the inside of the range space with angle brackets. Paint it to match the decor, then remove it when you leave the apartment.