The first four words in the title crawl are literally ‘a long time ago’ ;-)
But on a more serious note, it’s kind of a mix of both sci-fi and fantasy. There are fantasy tropes such as magic (the force), good and evil wizards (the Jedi and the Sith), swords and dueling (light sabers) etc. In many ways it is more like LOTR than Star Trek: Obi Wan is like Gandalf, Luke is like Frodo etc. Also none of the technology is ever explained, there is no techno-babble.
On the other hand there are lots of sci-fi elements such as spaceships, aliens, technology etc. So on the surface it seems like science fiction, but it borrows lots of stuff from fantasy.
You're right about that... I never thought that much about it. It actually makes sense.
I was always under the impression that by "a long time ago" meant that Earth was in the distant past and the events of the movies were always the present events
That's sort of exactly what it means. I always felt people were being a bit obtuse with the whole, "it's in the past therefore it can't be science fiction!". To your point, it feels like the future, relative to us, because they have futuristic technology and whatnot. When it actually takes place in a cosmic time sense is completely irrelevant.
Science fiction usually tries to stick to realism to a degree in how it uses futuristic tech and ideas. George Lucas didn’t really try to do that. He always called it a space opera