A granite countertop is usually glued to the cabinet, so if an unattractive gap develops between the granite countertop and the backsplash, you can't close it by pushing the countertop closer to the wall. If the backsplash is made of tile, you can't nail trim to the wall either, although that doesn't preclude using trim, which is usually the best solution. If the gap is too wide to caulk, you might be able to repair it with epoxy resin, but color matching and finishing epoxy resin take skill, so this job is best left to a pro.
Try Closing the Gap
Most granite countertops are glued, but some aren't, and if yours is one that isn't, pushing the countertop closer to the wall so you can caulk the gap is the easiest solution. Look under the countertop for clips glued to the underside, and if you see any, remove the screws sunk into the cabinet with a No. 2 Phillips screwdriver. When you've removed all the screws and the countertop is moveable, push it as close as you can to the wall, and when you replace the screws, angle the heads toward the wall so they will miss the original holes in the cabinet and make new holes.
Video of the Day
If the countertop is glued down, you may be able to move the entire cabinet back toward the wall. Remove the screws holding the cabinet to the wall using a drill and a No. 2 Phillips bit because you'll need the extra torque the drill provides. When the cabinet is free, have a helper wedge a flat bar under the bottom and lift it to pry the cabinet backward. Hold it there and when the cabinet is as far back as it's going to go, drive one screw and then have your helper release the flat bar before you drive the rest.
If you can manage to make the gap narrower than 1/4 inch, the best way to hide it is to fill it with silicone caulk with a color that matches the granite as closely as possible.
Cover the Gap With Trim
The most reliable way to cover a large gap is to use wood trim, and even though you can't nail it to the tile backsplash or the granite countertop, you can glue it. You want the trim to be as inconspicuous as possible, and wood quarter-round is usually the best choice. It comes in 1/2-, 3/4- and 1-inch widths, so choose the smallest one that will cover the gap. You can also use flexible quarter-round, but this isn't paintable, and you're unlikely to find it in a color that blends with granite. You may be able to match it with the tile color, though, and that may be good enough.
If you choose wood trim, finish it or paint it before you install it, not afterward. You can paint it a matching color or make it a feature by staining it and coating it with a clear finish. Install it with a strong adhesive, such as Gorilla Glue, or use contact cement. Glue it to the countertop or the tile backsplash but not both because you want to prevent damage if either of the surfaces should move.
Patching Gaps With Epoxy
Epoxy is hard and shiny just like granite, but the trick is providing support for it. One way is to cut a wooden shim to the same thickness as the gap, put some glue on one side and wedge it into the gap about 1/2 inch below the surface of the countertop. When the glue sets, you have a solid substrate for troweling on two-part epoxy resin (with an appropriate color) using a putty knife.