As has been mentioned, the question is a bit of apples and oranges, as the cer file is just the public key but the pfx file contains both public and private keys.
So a more fair question would be when would you want to use a pfx file as opposed to a pem file. Given that pfx files have been criticized for being overly complex, a fair answer to your second question might be: you would only ever want to use a pfx file if you're running IIS and its configuration absolutely won't let you use anything else.
Source: https://en.wikipedia.org/wiki/PKCS_12
(Referenced footnote is an article from Peter Gutmann.)