How many papers are expected a PhD student to write in order to be accepted on postdoc programs?
A post-doctoral position is not usually part of a "program." It is not like graduate school, leading some kind of higher certification. It is a job, doing research in a specific area. Hiring is done individually by the senior researcher overseeing a position, and what they may be looking for is highly variable. Some people may hire based primarily on people's publication output as graduate students; however, in most cases I am familiar with, hiring is done based on a holistic view of the candidate.
For example, when I applied for a post-doc in theoretical particle physics, I had only one publication out (and another one submitted), based on my graduate work. However, I came from a top graduate program, and I had a very strong letter from my advisor. I had to apply for a lot of jobs, but the one I eventually got was with somebody who had research interests very close to my advisor's. (The two had collaborated once, briefly, some years in the past.) I had a very broad background (having taken a lot more classes than most graduate students at my institution), and based on this and my advisors strong recommendation, I got a job.
One of my professors in graduate school had told me explicitly that it was much more important to learn a lot in graduate school than to publish a lot of papers. You are not going to get the opportunity again to broaden your base of knowledge in the same way, and how many papers you publish is probably less important than learning and networking and making a good impression on senior people. Once you have a post-doc, that is the time to really crank up your research output (to four or five papers a year in theoretical physics or applied mathematics, if you want to get a good faculty job).
"It would be nice if people from different fields would answer since this question would be of interest for scholars in different fields." In civil engineering, it really varies on the sub-field, but I would say at the PhD level, 5-7 journal articles (and few conference proceedings) will help boost your chances. In some sub-fields thu, having 2-3 articles is considered great!
For post-doc, (still in civil engineering), your PhD adviser, research topic, funding (availability/ability to write proposals) and list of publications is what really matters. But, I did not hear of any minimum number of publications (in my field, not sure about other fields).
I have a PhD in theoretical physics obtained in Germany and my department had as a compulsory statement in order to obtain the PhD to have submitted one paper to a journal. It was the only department I have come across with that rule, though.
Most graduate students in theoretical physics manage to write 1-2 papers during their programme, but even no paper is very common. I have not heard of any having published decent papers, from a decent university with more than 3-4 (unless you are unbelievably gifted and lucky).
To directly answer the question: PostDoc applications are usually decided on the base of a strong recommendation letter from your supervisor and, secondly, by the quality of your publications. Obviously the better the two above are, the more the chances to get a position; yet, there is no minimum statement required. Also notice that, especially in physics and mathematics, publishing too much and too often is usually seen as a sign of low quality research, as it feasibly takes a decent amount of time to actually find "new" results in those fields.