In China, you need to show your passport/identity card to buy the ticket, since free movement is restricted in this way. Therefore, they have to check when you board the train.
In Europe, Japan and Taiwan etc, it's a good idea to be there a few minutes before (especially if you're not familiar with the station), but it's always less time than required for getting on a plane.