Usually the context would be something like this: you have forgotten something important, arrived very late for an appointment,or have failed in some job you were supposed to do. As you prepare to offer your explanation/excuse/apology, your wife/boss/co-worker says, "This (had) better be good!" meaning "You had better have a really, really good excuse this time, because I'm out of patience and you're in big trouble!"
Another possible context - you have persuaded your wife to go to a sporting event, a movie or something else that she really isn't interested in. As it begins, she says "this had better be good" - meaning "if I don't like it, you're going to get all the blame for a ruined evening!"