Both.
It's a constitutional federal republic, which is a representative democracy.
And, it ain't perfect.
What is a representative democracy?
The United States of America is a representative democracy: citizens vote for their elected officials to represent the citizens’ ideas and concerns in government.
Citizens can also contact their officials when they want to support or change a law.
Why do some folks say the USA is not a democracy?
Because they're usually either accidentally or intentionally misrepresenting facts.
What they often mean is one of two things:
That the USA is not a direct/pure democracy open_in_new, though no one is legitimately arguing that it is. It's a representative/indirect democracy, where instead of voting on every government decision (direct), citizens elect representatives to vote on their behalf (indirect). Whether moving toward a more direct democracy would give Americans more liberty open_in_new can be an honest debate. But, pretending that direct democracy is the only form is either intellectually dishonest or ill-informed.
That the presidential election is not a popular vote open_in_new, unlike all other USA elections. There is a sound argument that the electoral college open_in_new has effectively disenfranchised much of the USA through gerrymandering open_in_new and further voter suppression open_in_new. This makes its democracy imperfect, but neither non-existant nor necessarily unimproving. Yet.
Note: If the USA did have a direct, popular vote for president, it still would not be a direct democracy. A popularly elected president, like all other elected officials, makes decisions unreliant on citizens' votes (in other words, they represent the citizens who elected them: representative democracy).
Some make interesting points worth critically considering, yet every author relies their conclusion on multiple strawman logical fallacies open_in_new (among others) such as confusing both indirect democracy, and a popular presidential vote, with direct democracy:
America Is a Republic, Not a Democracy open_in_new from The Heritage Foundation
Democracy or Liberty? open_in_new from CATO Institute
The United States Is Not a Democracy. open_in_new from Zinn Education Project