Only when there are things of the Dunya mentioned or may be a slight chit chatting about people.
But if you are in a circle of knowledge, you are not supposed to say that.
By the way, what you wrote is missing. The correct one is: subhanaka Allahumma wa bihamdika, Ash hadu alla ilaha illa anta Astagfiruka wa atoobo ilayka.