You can extend Gravity Forms and Gravity Flow with custom CSS, JavaScript, and PHP. The correct placement depends on your theme structure and the type of code you are adding.
For a complete guide on where to place CSS, JS, and PHP snippets in WordPress, see the Where Do I Put This Code? article.
Note: To avoid losing changes during theme updates, always use a child theme or a dedicated method for managing custom code.