Difference between CPM and TPM and which one for downstream analysis? What the difference between TPM and CPM when dealing with RNA seq data?

What metrics would you use if you have to perform some down stream analysis other than Differential expression for eg. 

Clustering analysis using Hclust function and then plotting heat map to find differences in terms of expression levels, correlation and pca

Is it wrong to use TPM for such analysis, if yes then when does one use TPM versus CPM.
You can find the various equations in this oft-cited blog post from Harold Pimentel. CPM is basically depth-normalized counts, whereas TPM is length-normalized (and then normalized by the length-normalized values of the other genes).
If one has to choose between those two choices one typically chooses TPM for most things, since generally the length normalization is handy. Realistically, you probably want log(TPM) since otherwise noise in your most highly expressed genes dominates over small expression signals.