When and how does bitcoin node sync itself?
Always.

When starting up, Bitcoin Core sends out a request to its peers to inform it about the best chains they know about (using a getheaders message). 

After that point, it is automatic: peers will immediately announce new blocks they knew about after they learn about them. This either happens using:


legacy inv mechanism, in which case just block hashes are announced
BIP130 (if negotiated), in which case announcements send full block headers
BIP152 high-bandwidth mode (if negotiated), in which case blocks are immediately transferred in full using compact blocks protocol