English uses "for" and "since" pretty loosely with time. French doesn't, each of these four words points to a specific kind of time relationship, and mixing them up is one of the most common mistakes English speakers make.
1. Depuis: an action that's still going on
Use depuis (since/for) with the present tense for something that started in the past and is still true now, this is the opposite of English, which uses a perfect tense here.
| J'habite ici depuis 2020. | I've lived here since 2020. (and I still do) |
| Elle apprend le français depuis trois ans. | She's been learning French for three years. |
2. Il y a: ago
Use il y a + a duration, with a past tense, for something that happened a certain amount of time before now.
| Je suis arrivé il y a deux heures. | I arrived two hours ago. |
| Il a vécu à Paris il y a longtemps. | He lived in Paris a long time ago. |
Don't confuse with "il y a" = "there is/are": the same phrase also means "there is/are" (il y a du café = there's coffee). Context tells them apart, a duration right after it signals "ago."
3. Pendant: for/during, a finished period
Pendant describes a duration without saying anything about whether it's still going on, it can be used with any tense.
| J'ai vécu à Paris pendant trois ans. | I lived in Paris for three years. (over, unlike depuis) |
| Elle a travaillé pendant toute la nuit. | She worked all night. |
4. Dans: in, the future
| Je pars dans deux heures. | I'm leaving in two hours. |
| Le film commence dans dix minutes. | The movie starts in ten minutes. |
5. Quick reference
| depuis + present | since/for, still true now |
| il y a + past tense | ago |
| pendant + any tense | for/during, a finished (or total) duration |
| dans + present/future | in, counting forward to the future |