Here’s how to decide whether investing in a postgraduate degree is a good idea.