The CSS changes are tied in with your theme.
If you change to a new theme, your custom CSS styles will no longer be active and if you change back to your previous theme, they will once again be there.
To add CSS Code on your WordPress website.
Appearance -> Customise
Select the option “Additional CSS”
Add CSS Code in the text field and click on “Publish”