The question is in the title: In both cases I use $R^2$ and chi-square to test if a fit/model is good enough. Up to now I only know that $R^2$ is used for models (?) and chi-square for fits/functions (?). Is this true? And how exactly do they differ?
Found this after a quick Google search:
$R^2$ is used to quantify the amount of variability in the data that is explained by your model. It's useful for comparing the fits of different models.
The chi-square goodness of fit test is used to test if your data follows a particular distribution. It's more useful for testing model assumptions rather than comparing models.
Sounds like the chi-square is more useful if you have a function you are trying to test (or a model you are trying to fit to your data) as opposed to the $R^2$, which tells you how much variability there is in your data, and therefore how much the best model fits.
The chi-square provides a per-feature measurement of dependency with the target. This is useful at the feature-selection stage, for a classification model. We'd like to weed out the low-dependent features. (scikit-learn guide for additional such measurements for classification and regression models).
$R^2$ provides a model-level measurement of the target's variance explained. This is useful at the model-evaluation stage. (scikit-learn guide for $R^2$)