At confession one day, I remembered after confessing my sins and when the priest was giving me advice to tell him I am single because of my sins that I confessed. But I did not tell him because I did not want to interrupt him. Is it mandatory to say in confession your state of life like if you are married etc. and was my confession valid?
It’s not mandatory, it’s to help the priest frame your situation. If you were withholding it purposely to conceal the gravity of your sin, that would be different. But clearly you were just being respectful, which does not affect validity. If it really bothers you, you can always bring it up at your next confession and ask the priest about it.