Even if you want to leave, there is no reason to close your account immediately.
Coincidentally, I felt yesterday that I should close my account. It is hard to explain why, but I felt that although the other members were always nice to me, I could not really be welcome. At the same time, I really wanted to stay. I decided to sleep on it. Today I felt the same way, and logged in with the intention of closing my account. However, after I logged in and read the new posts, etc., I could not understand why I had felt that way. I think that I sometimes have a kind of depression that affects my perception of how other people see me.
In your case, your reasons may be different, but keep your account open in case you feel differently in a few days or a few weeks.