Are there any atheist or agnostic American astronauts, past or present?
With the hundreds of astronauts who have been through the American space program, I am sure there are more than a few atheists and agnostics, but they're likely quiet about it. The only publicly self-identified atheist astronaut I know of is not American, ESA's Christer Fuglesang.
If no was this policy? (If no how did that happen and is there a policy going forward?)
If there was a policy against atheist astronauts it would be rapidly and loudly challenged. The US constitution states "no religious Test shall ever be required as a Qualification to any Office or public Trust", and that clause has been interpreted fairly broadly by the courts. Organized atheist groups would be constantly protesting NASA if there was even a hint of a policy against hiring atheists as astronauts.
The early astronauts were pretty open about their religion, and at that time, being a church-going Christian of some denomination was a big part of the image that NASA was trying to cultivate for those astronauts -- while I'm sure there was no formal policy saying the astronauts selected for the Mercury program had to be Christian, open atheists simply wouldn't have been selected at that time. On the flip side, it's impossible to know how many of these churchgoing nominal Christians actually were believers. It was very common in the 20th century US for atheists or agnostics to attend church to fit in with their communities.
Some of the Apollo astronauts seem to have had their religious beliefs strengthened by their experience, while others did not.
Apollo 15's James Irwin was a lapsed Christian but became a devout born-again Christian after his flight.
A16's Charlie Duke also became born-again in 1978 but it's not clear from his WP article what his religious practice was during Apollo.
Duke's A16 crewmate John Young was unmoved:
Interviewer: Did you discover God up there?
Young: No. I don’t think so.
Interviewer: No sense of awe? Wonder?
Interviewer: Why not?
Young: Because I think that the way things are in space are the way they are and I think that’s a good thing. I think that if people have to go into space to discover God, they have some other kind of problem.
This sounds like Young was an agnostic, but it's not necessarily conclusive.
A14's Ed Mitchell held unconventional spiritual beliefs.
In the shuttle and post-shuttle era, there was a significant shift in astronaut demographics: scientists and engineers constituted significant portions of the astronaut corps, which was previously dominated by military officers with test pilot training. Of the 12 Apollo moon walkers, for example, only one, A17 LMP Harrison Schmitt, was a scientist; on the later shuttle missions it was common for 3-5 members of a 7-person crew to be engineers or scientists. Atheists and agnostics make up a larger proportion of the scientific community than the military, so one would expect more of them in the 21st century astronaut corps.
Over the last several decades, a couple of things happened: astronauts became less celebrated, and American attitudes toward organized religion shifted. Since the public doesn't see as much of an astronaut's private life as they did in the 1960s, it's easier for an astronaut to keep their beliefs -- religious or not -- private. Fewer Americans are involved in organized religion today, and to avoid conflicts, many Americans avoid raising the topic of religion, especially in the workplace, and doubly so in government workplaces.