The Founders of the nation's governing structure understood that citizens might not be politically well informed, thus a representative democratic structure was preferred rather than a pure or direct democracy. What is the role of public opinion in the American political system?
The Founding Fathers clearly intended the public to have a voice in how it was governed. In fact, the very first article of the U.S. Constitution establishes a Congress with a House of Representatives and a Senate precisely to both ensure the public's interests are represented and that those interests are balanced with the broader national interest. The House of Representives was designated as the federal government institution most directly responsive to the public's wishes. That is why members of the House must stand for reelection every two years, while senators serve six year terms. The intent was for the House to be more responsive to the narrow interests of each representative's constituents, while the Senate would be more insulated from those narrow interests by virtue of its members' not having to stand for reelection so frequently.
Lest one be tempted to underestimate the extent to which the Constitution's drafters remained concerned about the public's influence in how it is governed, the following quote from Federalist Paper No. 50, written by James Madison, should help:
"The members of the legislative department...are numerous. They are distributed and dwell among the people at large. Their connections of blood, of friendship, and of acquaintance embrace a great proportion of the most influential part of the society...they are more immediately the confidential guardians of their rights and liberties."
The distinction between a direct democracy and a republic referenced in the question is important, and more than a little reflective of the Founders' concerns regarding the unwieldiness of governing according to a nationwide vote on every matter that arises. And, the Founders' were certainly about the survival of democracy in an environment characterized by an ill- or uninformed electorate. That the consent of the public was a sine quo non of the form of government established, however, is absolute.
There is no official or constitutionally mandated role for public opinion in the American political system. That is, the Constitution does not specify what role public opinion will have. Therefore, the role of public opinion is somewhat contingent on the circumstances.
Public opinion is transmitted to the government in two main ways. First, it is transmitted through voting. People vote for one candidate or the other, thus implicitly letting the government know what policy positions they approve of and what policy positions they dislike. Second, public opinion is transmitted through interest groups. The interest groups let members of government know what their members believe.
Governmental officials then have some degree of latitude for how they treat that opinion. Sometimes, they follow public opinion. Other times, public opinion may not be clear enough on an issue and so they cannot follow it. There is no one answer that fits all circumstances.
Thus, public opinion can, at times, play a large role in what our government does. At other times, the public opinion is not clear enough and members of government are not guided by it.