There are 10-15 high speed trains between each way per day Beijing and Shanghai (4.5 to 5.5 hour journey time).
Planes are nominally faster (2.5 hours), start earlier (6:30am) and end later (last departure is ~10:30pm, whereas last fast train is ~7pm). There are several airlines serving that route, meaning planes leave roughly every half an hour, and tickets can be had for as little as $110 one way (more at more sane hours or if you buy closer to the date of travel).
There are ~10,000 flights in each direction each year.
Huh. I stand corrected. I am surprised it's so few. Possibly a shortage of rolling stock as I hear the line is reaching capacity on weekends.
Nonetheless, the capacity is certainly there with low marginal costs now the infrastructure is built. They could run one every 5 minutes if they wanted - think Tokyo-Osaka. Give it time!
I understand why they don't feel the need to increase frequency (it's actually easy enough to buy a tickey for next day travel) but I don't understand why they don't run all the 'fast' trains at the faster sub-5h speed.
Sorry, I intended to explain that later in the comment, but got distracted and then just submitted without re-reading.
The flight time is nominally ~2.5 hours, but many/most planes leave late, meaning the actual flight time for the passenger (time between scheduled departure, and actual arrival) is >3 hours.
And airport security and boarding takes longer than train security and boarding. So the time saving isn't all that much vs. the fast train.
If you look only at the stated (=named) departure and arrival times, the plane looks much faster (nominally). If you consider that you need to be at the airport at least 1h before departure, and frequently airports are outside the city centre while train stations are in the city centre, that nominal advantage shrinks considerably.
There are trains that run all through the night and can get you from Shanghai to Beijing for a morning meeting.
The D312 leaves Shanghai at 7:10pm, and arrives at Beijing South station at 7:07am. Even if it takes 45 mins to get a taxi, you can still make it to financial street or the central business district for a 9am meeting :)
Seriously, though, would you prefer to take a 6:35am plane, or (if it were available) a 4:10am train scheduled to arrive at the same time? Going to bed at 9:30pm in order to leave for the airport at 4:45am isn't terribly disruptive. But taking the train would likely force you to split your night's sleep into two chunks.