I've worked here for two years usually means "I've worked here for two years and I still do". Occasionally it might simply express express the continued relevance of the past to the present, e.g. "I've worked here for two years - but I've just been fired". Without the expression of time, it could similarly express the relevance of a past event: "Have you ever worked here before?" / "I've worked here before, about a decade ago. I'd be grateful if you'd consider giving me a job here again now."
I worked here for two years usually means "I worked here for two years, at some time in the past, and I no longer do". Depending on context, it could also describe a situation where the speaker still works there today - e.g. (1) "I worked here for two years before Bob left - and I've worked here for five more years since then"; or (2) "I worked here for two years in the 1990s, then I left - and now I'm back again".
I've known her for two years means "I've known her for two years, and I still do".
I knew her for two years usually means "I knew her for two years, at some point in the past, and I no longer know her". Depending on context, it could also describe a situation where you still know her - e.g. "I knew her for two years before she got married (and I've known her for a further three years since then)".
Similarly, I've been hungry for two hours usually expresses continued hunger, while I was hungry for two hours describes the duration of past hunger.
I am hungry for two hours would only make sense if you were describing a regular event or consequence, e.g. "I am hungry for two hours every day between 4 and 6 pm!" or "If I skip lunch I find that I am hungry in the afternoons".