It looks bad when a chap gets out of line (5)
I believe the answer is:
stain
'it looks bad' is the definition.
The definition suggests a singular noun which matches the answer.
'a chap gets out of line' is the wordplay.
'a chap' becomes 'stan'.
'gets' means one lot of letters goes inside another (gets can mean captures or absorbs).
'out of line' becomes 'i' (I can't justify this - if you can you should give a lot more credence to this answer).
'stan' going around 'i' is 'STAIN'.
'when' is the link.
Can you help me to learn more?
(Other definitions for stain that I've seen before include "Satin (anag.)" , "Discolouring mark" , "Discoloration" , "Blotch on satin" , "Discoloured mark" .)