I’m not exactly sure under which circumstances is line or row the more suitable term.
In Portuguese, they both translate to the same word linha, which can be used for both a drawing line or for an item in a table.
There is substantial overlap in meaning, and if you use one where the other would've been more appropriate, native speakers will still understand what you meant; so don't worry about it too much.
For your purposes, I think the most important distinction is that row can only be used to refer to an arrangement of discrete items. For instance, in the sentence "He drew a line between the two points on the map", line cannot be replaced by row.
I can't presently think of an example where I'd say you can't go the other way -- replacing row with line -- but there certainly are cases where it would be odd. For instance, we normally always speak of a table of numbers having rows (which are always horizontal) and columns (which are always vertical). If you referred to a line of a table, that would be peculiar, but not wrong, and I think would be understood as unambiguously horizontal (by analogy with lines of text on a page, which are always horizontal ... well, as long as you're not talking about one of the East Asian languages that can be written vertically, anyway).
If you were talking about a group of people queued for service (such as at a ticket window), you'd normally say a line of people. But, once seated inside the stadium or auditorium, they become a row of people.
It's similar with cars: on the highway at rush hour, it's a line of cars, but, in the parking lot, it's a row of cars.
One distinction seems to be that, if the objects are end-to-end, it's more likely to be a line, while if they are side-by-side, it's more likely to be a row. That may be a decent guideline to start with, but I'd caution against using it as a hard-and-fast rule. For one, it would be hard to apply that standard to, say, trees. In the case of trees, though, I think the wording might depend on the perspective of the onlooker: if the trees were spread across the landscape, they would form a row of trees, while, if they stood one behind another off into distance, that might be a line of trees (as in a tree-lined street).
Technically, a line is a row of contiguous elements. Furthermore, a line does not ordinarily need to be a straight-line.
A row is always visualized as rectilinear. A row does not necessarily have to have all its elements touching each other (without a gap).
However, in general English usage, the terms are treated loosely as synonyms.