And after updating my theme I must add the code again, right?
That piece of code goes into functions.php file of your theme. When you change themes, you will have to make sure that the code is retained in functions.php file of your new theme.
When you are merely updating your theme to a higher version, you might not have to do it unless the theme developers change the content of functions.php. Good theme developers usually provide a separate <custom>_functions.php file for you to add your own custom code. If there is one, the code goes there and you needn't have to worry about updating your themes.