Are mere thoughts about impure things always sinful in themselves? Mere thoughts about impure things are not always sinful in themselves, but such thoughts are dangerous.
When do thoughts about impure things become sinful? Thoughts about impure things become sinful when a person thinks of an unchaste act and deliberately takes pleasure in so thinking, or when unchaste desire or passion is aroused and consent is given to it.
What is forbidden by the ninth commandment? The ninth commandment forbids all thoughts and desires contrary to chastity.
Deeper reading -> CCC 2517-2533