The answers by Edlothiad and Mark Olson are good, but omit some details.
According to The Return of the King, Appendix B The Tale of the Years, The Third Age, Third age 3019:
*January*
15 The Bridge of Khazad-Dum and fall of Gandalf. The Company reaches Nimrodel late at night.
17 The Company comes to Karas Galadon at evening.
23 Gandalf pursues the Balrog to the peak of Zirak-zigil.
25 He casts down the Balrog and passes away. His body lies on the peak.
*February*
14 The Mirror of Galadriel. Gandalf returns to life, and lies in a trance.
16 Farewell to Lorien. Gollum in hiding on the west bank observes the departure.
17 Gwaihir bears Gandalf to Lorien.
So presumably Gandalf and the Balrog fell into deep water sometime on January 15, since presumably they would not take until January 16 or later to reach the bottom.
They then fought for an unknown length of time before the Balrog fled and Gandalf pursued him through the tunnels and then up the Endless Stair. On January 23, after eight days of fighting, chasing and climbing, Gandalf and the Balrog reached Durin's tower and resumed fighting on the peak of Zirak-zigil. So Gandalf was actually still alive when the Company told Galadriel and Celeborn he was dead, and started mourning him. Gandalf killed the Balrog's body on January 25 after two days of fighting on the peak and then died.
Gandalf's body came back to life on February 14, after being dead for 20 days.
So those dates should be remembered when reading Gandalf's account of the battle with the Balrog.
January 15:
'Come, Gandalf, tell us how you fared with the Balrog!'
'Name him not!' said Gandalf, and for a moment it seemed that a cloud of pain passed over his face, and he sat silent, looking old as death. 'Long time I fell,' he said at last, slowly, as if thinking back with difficulty. 'Long I fell, and he fell with me. His fire was about me. I was burned. Then we plunged into the deep water and all was dark. Cold it was as the tide of death: almost it froze my heart.'
'Deep is the abyss that is spanned by Durin's Bridge, and none has measured it,' said Gimli.
January 15 to 23:
'Yet it has a bottom, beyond light and knowledge,' said Gandalf. 'Thither I came at last, to the uttermost foundations of stone. He was with me still. His fire was quenched, but now he was a thing of slime, stronger than a strangling snake. 'We fought far under the living earth, where time is not counted. Ever he clutched me, and ever I hewed him, till at last he fled into dark tunnels. They were not made by Durin's folk, Gimli son of Glóin. Far, far below the deepest delving of the Dwarves, the world is gnawed by nameless things. Even Sauron knows them not. They are older than he. Now I have walked there, but I will bring no report to darken the light of day. In that despair my enemy was my only hope, and I pursued him, clutching at his heel. Thus he brought me back at last to the secret ways of Khazad-dûm: too well he knew them all. Ever up now we went, until we came to the Endless Stair.'
'Long has that been lost,' said Gimli. 'Many have said that it was never made save in legend, but others say that it was destroyed.'
'It was made, and it had not been destroyed,' said Gandalf. 'From the lowest dungeon to the highest peak it climbed. ascending in unbroken spiral in many thousand steps, until it issued at last in Durin's Tower carved in the living rock of Zirak-zigil, the pinnacle of the Silvertine.
January 23 to 25:
'There upon Celebdil was a lonely window in the snow, and before it lay a narrow space, a dizzy eyrie above the mists of the world. The sun shone fiercely there, but all below was wrapped in cloud. Out he sprang, and even as I came behind, he burst into new flame. There was none to see, or perhaps in after ages songs would still be sung of the Battle of the Peak.' Suddenly Gandalf laughed. 'But what would they say in song? Those that looked up from afar thought that the mountain was crowned with storm. Thunder they heard, and lightning, they said, smote upon Celebdil, and leaped back broken into tongues of fire. Is not that enough? A great smoke rose about us, vapour and steam. Ice fell like rain. I threw down my enemy, and he fell from the high place and broke the mountain-side where he smote it in his ruin. Then darkness took me; and I strayed out of thought and time, and I wandered far on roads that I will not tell.
January 25 to February 14:
Then darkness took me; and I strayed out of thought and time, and I wandered far on roads that I will not tell.
February 14 to 17:
'Naked I was sent back - for a brief time, until my task is done. And naked I lay upon the mountain-top. The tower behind was crumbled into dust, the window gone; the ruined stair was choked with burned and broken stone. I was alone, forgotten, without escape upon the hard horn of the world. There I lay staring upward, while the stars wheeled over, and each day was as long as life-age of the world. Faint to my ears came the gathered rumor of all lands: the springing and the dying, the song and the weeping, and the slow everlasting fro groan of overburdened stone. And so at the last Gwaihir the Windlord came and took me up and bore me away.'
February 17:
And so at the last Gwaihir the Windlord came and took me up and bore me away.'
'Ever am I fated to be your burden, friend at need.' I said.
'A burden you have been,' He answered. 'but not so now. Light as a swan's feather in my claw you are. The Sun shines through you. Indeed I do not think that you need me anymore: were I to let you fall, you would float upon the wind.'
'
'Do not let me fall!' I gasped, for i felt life in me again. Bear me to Lothlorien!'
'That indeed is the command of Lady Galadriel who sent me to look for you.' He answered.
Thus it was that I came to Caras Galadon and found you but lately gone....