I want to know when can we can use "what a shame".
You can say "When can we use "what a shame"?" with the "can" before "we" if it is a question. If you start your sentence with "I want to know..." then technically it will be a statement, instead of a question so you need to reverse the word order and end it with a period (full stop).
I want to know when can we ues " what a shame"?