It is wholly unpleasant to suffer through a super-humid, sweaty, sleepless night sans air-conditioning—this is especially true if you live in a small room with a small window, with no cross-ventilation or ceiling fan to properly circulate the air. Still, while a hot night is bad, an apartment fire is worse, and it's important to adhere to some safety rules so you don't reduce your home to a pile of ashes. First and foremost: do not connect your air-conditioner window unit to an extension cord.
The FDNY specifically warns against using extension cords or power strips for large electrical appliances like air-conditioners, along with televisions, clothes dryers, refrigerators, and freezers, warning that extension cords are "only for temporary use," and cannot handle as much current as permanent wiring. Air-conditioner cords are purposefully thick and short because A/Cs use so much electricity—if you hook up your unit to a typical extension cord you pick up at a hardware or drug store, the plug, socket, or entire length of the cord can overheat, causing fires that can occasionally be fatal.
Of course, in rentals we're often at the mercy of cost-cutting landlords, and it's not that uncommon to find your only room's outlet is located too far from your room's only window. This is an unfortunate discovery, particularly if it happens at 3 a.m. on an 80-degree night and your A/C is drilled into your window so you end up sleeping with your door wide open and confusing your roommates when they wake up to use the bathroom.
There are heavy-duty extension cords that are specifically designed for major appliances like air-conditioners. These should be shorter cords with lower gauges (12 or 14 gauge) and higher amp ratings. If you are in need of one of these, take a photo of the sticker attached to your A/C plug that should list the electricity units the air-conditioner uses, then bring it to a knowledgeable employee at a hardware store and see if there's something they can recommend. For the sake of yourself and your neighbors, do not try to figure this out yourself, assuming you are not specifically trained in electrical wiring. That is potentially how my apartment building caught fire last year, and I can promise you it is not fun.
Another option is to petition your landlord to install another outlet, if you are in a rental. You must go through the landlord to ensure you're not overloading the wiring, which can cause an electrical fire. He or she might say no, but you can bring up the safety issue and offer to split or front the cost to pay for the sockets.
There are also a number of ways to stay cool without an air-conditioner. You can use a properly-rated extension cord for a window fan, or purchase a few standing fans and place them around your room strategically so you can circulate the air. Make sure you're sleeping on all-cotton sheets, keep your blinds closed, and buy this weird cooling pillow if you must. Think cool thoughts. Sweat out the booze.
Remember that if you do have an air-conditioner (that's plugged properly into a wall), it is imperative that you install it in your window correctly, lest you kill an unsuspecting person on the sidewalk below.
And above all, GET RENTERS INSURANCE—just because you're savvy enough to stay away from fire hazards doesn't mean your neighbors are!