If BGP is used in multihoming scenario then primary link gets fail, after how long traffic will be shifted to secondary link?

By default, fast external failover is enabled for eBGP neighbor. So when the egress interface fails, it immediately bring down the BGP session and next best path will be selected. if you have it disabled, it will rely on the BGP holdtimer.