Depends an awful lot on your specific conditions - but here are some thoughts, assuming on basically flat ground an a 12x20 addition - a typical 1 car garage size:
1) Before you get underway and committed to this project, check your subdivision plat covenants and local land use regulations. Most areas have requirements for how far buildings have to be from property lines ("setback"), how many square feet your house can be, etc. Some also have restriction on how far additions or extensions can go behind a house, how big detached buildings can be, how many feet or garage door width you can have, etc. Also, if you add new floor space some jurisdictions mandate additional outside parking space too, regardless of whether it is living space or not. If you are not up to checking this out yourself, local architects are familiar with the requirements.
2) Also consider, and preferably talk to your favorite Realtor, about whether in your area the added garage size will increase or detract from house value, and whether the added size will make the house "outsized" for the neighborhood and thus hard to sell, and also if making the extension 2 story (if rest of house is also) would add enough value to consider doing that - either as added bedroom and bath space, as a sunroom/conservatory, or as a stand-alone hired help or apartment setup.
3) Extending off the "end" is generally cheaper than off the "back" if you have a one-story house, because you do not have to reroof the existing garage at a flatter slope to extend the roof reach to the back of the new addition - you can just add onto the "end" of the house with new 3-sided foundation, walls, and roofing as an addition without messing with the existing building other than to remove existing end siding and cut door or passageway openings in the end wall, assuming it is OK by you for the additional garage to act as a "standalone" rather than added open space to the existing garage. If you want it to be connected open space for all 4 parking spaces, then either way you either have significant ($10,000-20,000) roof or endwall structural modifications to do.
4) doing this on an architecturely fancy house is a lot more expensive than on a cheaper house, because of the cost of maintaining architectural coherence and continuity - i.e. making it look like it is NOT an addition.
5) depending on frost depth in your area (therefore, depth of footings) the foundation can ran from a $3-5,000 for simple slab on grade construction to $12,000+ for northern-tier states or expansive soil or for very soft, swampy soil conditions where you may need deep foundation walls.
6) remember this will be adding volume and wall and roof space to the house, so your heating and air conditioning system may have to be replaced to handle the added load. This is commonly neglected in this sort of upgrade. Of course, if you make it wide enough to allow easy use by itself fully walled in (as opposed to extending the garage open space), then it could be treated as a separate HVAC space - with separate ducting control for AC if wanted, and independently-controlled separate stand-alone heating unit (like a supplemental natural gas or electric heater). Of course, upsizing your HVAC system can cost $1-10,000 depending on whether you go with supplemental units or total system replacement, and the additional space will of course increase your annual heating.cooling cost.
7) consider the roof design - flat roof is cheapest but most likely to leak, while a raised peak or bumped-dormer design might allow you to put an artist's loft or sunroom or big storage loft on top of it to help justify the expense of the roof, which is a major part of the cost on a garage addition.
8) if you go with an extension to the third bay, consider sizing it to hold a good-sized boat or full-length SUV/pickup regardless of the size of your car, for resale value purposes. If building a new access with a new garage door, consider oversizing the height and length a bit to handle any size consumer SUV or pickup with topper (say up to Ram or F250 - 300 size), and leave room for working on a large vehicle and getting around both ends at the same time - this might mean a 25-30' depth, but could add resale value.
9) however you do it, unless you go with the carport design, the more you can make it a versatile space for future owners, the more valuable it will be - i.e. if it could fairly easily be converted into a pool room, game room, craft room, man-cave, workshop, spray paint booth, storage room, etc it gains value.
10) If built onto a 2-story house, consider making building framing and foundations are suitable and roof is designed to be raised for adding a second story in the future unless that is banned in your area, even if you do not want to do that now. For probably about $1-2,000 additional you can provide that option (with design documents in-hand) for future buyers - which could increase resale value.
11) One other alternative if you are tight on funds, is to build it as an extension or adjacent unheated enclosed carport for vehicle/boat parking only, with gravel or crushed rock or soil-cement floor, shallow pier or post foundations, uninsulated walls, and sided and roofed but structurally isolated from the house - this could cut your overall cost by 30-50%. You could install electric and a stand-alone ceiling-hung fan/heater unit for heat when you are working in there, like in a detached workshop or shed, but have it unheated the rest of the time. If on the side of the house, gets own garage door. If extending an existing bay, then could use a rollup door between the two spaces.
12) Consider (probably with a architect) whether you want to extend the first or third bay - depending of course on how much utility junk like HVAC system and hto waer heater is blocking width in the first bay. If hyou put it on the first bay, more convenient to get to as an alternative use room, and could also be tacked onto later for a further extension off the back of the house for bigger bedroom or kitchen space or whatever is next to the garage. This is of particular note if a 2-story house, as the upstairs might be more accessible from the center of the house than the end.
All in all, I would think about ideas, google home show and website articles and videos on garage additons, talk to the Realtor, check out zoning regs, and so forth - then unless you settle for the simple carport option, get an architect involved to help you optimize psace use and appearance, then do plans and specs and construction estimate, and help you select a general contractor.
Bottom line - in the best case for 12x20' probably $10,000-14,000 - more likely $20,000 for shallow foundations, $25-30,000 if you need deep foundations, $40-60,000 with the second-story option. If bigger than 12x20, then roughly proportion by square footage, as applicable.