Even if the statement or opinion that 'Ali has only sworn allegiance to Abu Bakr a few months later is the one that has strongest evidences. There are evidences that say he gave his allegiance twice the first time at the second day and the second time after the death of his wife Fatimah as for the explanation for this final allegiance scholars say that was explained by the illness of his wife for whom he carried these months:
Al-Haafiz Ibn Hajar (may Allah have mercy on him) said:
It was as if they excused him for not coming to swear allegiance to Abu Bakr whilst Faatimah was still alive, because he was preoccupied with caring for her during her illness, and consoling her for the grief she felt at the loss of her father (blessings and peace of Allah be upon him). Moreover, when she got upset with Abu Bakr’s response when she asked him about inheritance, ‘Ali decided to go along with her in keeping away from him.
End quite. Fath al-Baari (7/494) (Source: islamqa #147540)
The strongest ahadith quoting this -final- allegiance you may read the long hadith starting with the story were Fatimah asked Abu Bakr about her heritage and which later show that 'Ali in fact nowhere pretended that Abu Bakr was an usurper, but a man who was close to the Prophet:
... then 'Ali uttered Tashah-hud and said (to Abu Bakr), "We know well your superiority and what Allah has given you, and we are not jealous of the good what Allah has bestowed upon you, but you did not consult us in the question of the rule and we thought that we have got a right in it because of our near relationship to Allah's Messenger (ﷺ) ." Thereupon Abu Bakr's eyes flowed with tears. And when Abu Bakr spoke, he said, "By Him in Whose Hand my soul is to keep good relations with the relatives of Allah's Messenger (ﷺ) is dearer to me than to keep good relations with my own relatives. But as for the trouble which arose between me and you about his property, I will do my best to spend it according to what is good, and will not leave any rule or regulation which I saw Allah's Messenger (ﷺ) following, in disposing of it, but I will follow." On that 'Ali said to Abu Bakr, "I promise to give you the oath of allegiance in this after noon." So when Abu Bakr had offered the Zuhr prayer, he ascended the pulpit and uttered the Tashah-hud and then mentioned the story of 'Ali and his failure to give the oath of allegiance, and excused him, accepting what excuses he had offered; Then 'Ali (got up) and praying (to Allah) for forgiveness, he uttered Tashah-hud, praised Abu Bakr's right, and said, that he had not done what he had done because of jealousy of Abu Bakr or as a protest of that Allah had favored him with. 'Ali added, "But we used to consider that we too had some right in this affair (of rulership) and that he (i.e. Abu Bakr) did not consult us in this matter, and therefore caused us to feel sorry." On that all the Muslims became happy and said, "You have done the right thing." The Muslims then became friendly with `Ali as he returned to what the people had done (i.e. giving the oath of allegiance to Abu Bakr). (Sahih al-Bukhari and Sahih Muslim)
Ibn Kathir in his history (called) al-Bidayah wa an-Nihaya البداية والنهاية (the Beginning and the Ending) has compiled a chatpter about the fact that Prophet's don't leave heritage, after quoting hadith evidences quotes that abu Bakr () -after the death of the Prophet found al-Hassan -the son of 'Ali and Fatimah- playing and carried him and exclaimed or highlighted the resemblance of al-Hassan to his grand father while 'Ali smiled -which is used as a fact that shows that there was no dispute between both 'Ali and Abu Bakr. The hadith can be found in Sahih al-Bukhari:
(Once) Abu Bakr offered the 'Asr prayer and then went out walking and saw Al-Hasan playing with the boys. He lifted him on to his shoulders and said, " Let my parents be sacrificed for your sake! (You) resemble the Prophet (ﷺ) and not 'Ali," while 'Ali was smiling.
As to the source for the hadith saying that 'Ali in fact gave his allegiance the next day there are a few weaknesses in this source which are addressed in the Fatwa from islqma I've quoted from. It appears in Tarikh Dimashq of ibn 'Asakir (see here in Arabic) who has narrated it via imam al-Bayhaqi and was also quoted in al-Bidaya wa an-Nihaya (see here in Arabic) were ibn Kathir quoted a statement made by al-Hafidh abu 'Ali an-Naysaburi أبو علي النيسابوري -A Student of ibn Khuzaymah and teacher of al-Hakim who was a teacher of al-Bayhaqi- (which was also quoted and translated in the fatwa from islamqa) saying:
I heard Muhammad ibn Ishaaq ibn Khuzaymah say:
Muslim ibn al-Hajjaaj came to me and asked me about this hadith, and I wrote it for him in a document, and read it to him, and he said: This hadith is worth a camel. I said: Worth a camel? It is worth a pearl the size of the full moon! End quote
So this hadith also appears in al-Bayhaqi's as-Sunan al-Kubra (here) -where he quoted the statement of al-Hafidh 'Ali an-Nasyaburi- and added a second chain through which he knew about the hadith and it appears in al-Hakim's al-Mustadrak (here)-where he claims that it is sahih according the conditions of both Sahih's- imam a-Dhahabi qualified the hadith as good, but containing some objectionable matters. As I'm not a good translator let me give you a short summary: The hadith tells the story how the allegiance for abu Bakr happened and that abu Bakr didn't see 'Ali nor az-Zubayr and asked about them and both came later and gave their allegiance.