"She gave me a bag of fruit."
Duolingo is trying to build an equivalence between 了 and English past tense, which is not true. I have no strong objection except that they should make a remark it's a simplified model for easier learning.
Both with 了 and without 了 can be a good sentence. Just an isolated sentence like this is insufficient to tell it is needed or not. Basically, just a description of the action does not require 了; to indicate a change of state of facts or the resultant state of facts due to the action, we need 了.
The explanation above is a bit off.
verb + 了 means bounded action. It can be bounded because you count how many times it happened, or because you say that it preceded something else.
sentence + 了 means currently relevant situation. Usually it's reporting on a past change of state that is relevant, but it can also describe realizing that something is relevant, apart from it changing.
verb + 了 can only mean change of state when the verb is last in the sentence.
But no, it's not a past tense marker either, and Duolingo should stop trying to treat it like one.
Reference: Li and Thompson, Mandarin Chinese: A functional reference grammar.