Powering a Window Air Conditioner -- 10' 12/3 SJTW extension cord vs new outlet?
R.E. Has a great litmus test.  If you are going to sell, rent or AirBnB the place like this, fit a proper receptacle. Otherwise...

It's about cord damage, and melting extension cords

A lot of Electrical Code and UL rules come from data science. 

Most consumer extension cords are intended for, you know, lamps. They are 16-18AWG, good for 7.5-10 amps in ideal conditions, but they often have problems at connector ends.  Historicaly A/C units pulled as much as 13 amps (less now, since Energy Star and SEER).  As such, it's a high priority for NFPA and UL to discourage extension cord use, because consumers will make bad choices in extension cords.  

However, via data science, it has emerged that a large number of casualties happen because of frayed air conditioner cords.  This is why air conditioners use funny cords, and have that GFCI-looking thing on their plug.   It is actually optimized to detect cord damage.  Needless to say, that gadget can't protect an extension cord - so an extension cord defeats its purpose.

Use an extension cord ...carefully

This is me advising going against UL advice and Code, if you are able to take responsibility for the reasons.

Or, use surface conduit

You add a "starter box" at your receptacle, then follow the wall to a suitable location.  #12 THHN wire will suffice, presuming it is actually a proper, mains-listed surface conduit system like Legrand Wiremold, and not merely a cord-organizer intended for ethernet and the like.