How early to arrive depends on your risk tolerance and knowledge of the station. Last week I arrived at Hongqiao 25 minutes before my train and had to pick up a ticket already purchased online. No issue. If worst comes to worst, you cut the line.
I have been to many stations and rarely wait more than 2 minutes for security. I have seen longer lines in some stations like Shenzhen north but then there is a special express line for those leaving in the next few minutes. In Beijing they have a special ticket pick-up counter next to the entrance for those who are tight on time.