I am using a panel data study as a guide for my paper, in which they detrend the population growth variable. However, I'm only performing an OLS analysis and I was therefore wondering if detrending in needed. If so, how can it be done in GRETL?
[Edit: After posting the answer initially, I realized that maybe you don't want to do a panel-data study. This is not obvious from your question in my view, because "OLS" is an estimator which can also be used with panel data, it does not automatically mean "not a panel". Anyway, my answer refers to the panel case. For time series data you have the first and third option below as well. (Time dummies wouldn't work in a non-panel setting.) Just replace any fixed-effects suggestions by a simple constant term and use plain OLS regression.]
I agree with the comment by hoyem that the question is a little vague, and that whether or not to detrend depends mostly on the context and the subject matter. Having said that, let me answer the part "how can it be done in gretl?". I'm assuming you want to use the GUI as much as possible (gretl can be used with menus or with typing commands).
First, you could indeed add a (linear) trend term to your model. To do this, with your panel dataset already loaded choose from the menus "Add / Time trend". Then you have a new variable "time" which you can add to your model like any other. This of course will not only affect population growth, but the whole model.
Second, a more general catch-all approach is to add time dummies, where the effects will not be constrained to be linear in time. In gretl in the panel model specification dialog you have a tickbox "with time dummies" for that which you simply have to tick, without having to create the time dummies explicitly before.
Third, if you only want to detrend a single variable, you could run a simple fixed-effects model for that variable on the (previously created) trend term. (A pooled OLS regression for detrending does not seem like a good idea if there are significant group-specific intercepts in that variable.) From that model you can save the residuals to your dataset with "Save / Residuals" in the model output window. This variable ("series" in gretl terms) is your detrended result for further use in the actual model.
(A variation of the third variant is to regress on time dummies instead of the trend term.)
Sorry if this answer comes too late for you, but good luck in any case.