You'll get your deposit returned if you end your secured card account in good standing, which means you've paid it off in full. You should get your deposit refunded if you upgrade your account to an unsecured card from the same issuer.