What it means
It means acting risky or making out that you are, from proper reckless stuff to tiny daft little rule-breaks. People say it straight when someone's genuinely pushing their luck, but most of the time it's dry sarcasm for mock-heroic behaviour. Ideal for ribbing a mate who's treating a very minor act of rebellion like extreme sport.
Usage examples
"So you bought the full-price meal deal and didn’t even scan your Clubcard, yeah? Living on the edge, mate. Next you’ll jaywalk outside the chippy."
"Ooh, decaf after midday, look at you living on the edge."
"He drove to Scotland on a quarter tank, said he was living on the edge, we said he was just tight."
"She used the out-of-date ketchup and went, I'm living on the edge tonight. Proper renegade behaviour."
"Paid the rent at 11:58 and started grinning like he'd climbed Everest. Living on the edge, lad."
Where it comes from
The phrase comes from the older literal image of being right on the edge of a cliff, roof, drop, or other dangerous limit. By the late 19th and early 20th century it was being used figuratively in English for living dangerously or taking risks, and that sense stuck hard in everyday speech.