The latest to buy a ticket is 5:50, and the latest to enter is 6:00. I took a photo, and there are some times on it.
It seems to be around 5 o’clock. Check it online
Closed at 5:50 p.m. and 12:20 to 3 p.m.
The cathedral closed at 18:00. I booked the ticket on Ctrip and walked up the stairs to the top at 11:30. It turned out that I was late and went in without anyone asking.