There are no real secrets to cheap places to stay in NYC, I am afraid, IME. it's bloody expensive.
There are a couple of big chain hotels in Downtown Brooklyn that are occasionally discounted and can be good – just a hope across the bridge so a cheap cab ride/quick subway fare away from Manhattan. Don't book the Best Western or the other chain hotel that's in Long Island City/Queens – they're very close and convenient to Manhattan but they're in a horrible industrial neighbourhood and surrounded by highway ramps.
I have no experience of staying in New Jersey. One thing to consider: commuter transport into NYC can be great (or at least fine) during the week but not so good at weekends.
I wouldn't bother staying at the airport for any reason: it's a long haul into town, it's all horrible around there and I don't even think it's that cheap.
Other options to consider: craiglist (can be a bit scammy) or stayz (my brother just used them in NYC and thought it was great).