tl;dr five or three timelines, depending on if time travel always creates a new timeline or not
Assuming Banner's both statements about time travel are correct:
- The grandfather paradox cannot happen, so time travel always creates a new timeline since some things are bound to change (the butterfly effect, but the changes can be minor). The very act of time travel introduces a change.
- Returning the infinity stones "uncreates" those new timelines. The Ancient One gives the Time stone to Banner trusting the stones will be returned, suggesting Banner is correct as one would assume the keeper of the Time stone know this time stuff. The "uncreating" cannot mean that those timelines would just cease to exist, as Captain America who is returning the stones needs to exit those timelines. Therefore, these timelines are merged with the original timeline (the taking and returning of the stones happens during the same timeline; with one exception).
As mostly already pointed out by @Chris (see the graph), we have the following timelines (pre-merging of timelines due to the return of infinity stones):
- Original MCU timeline (where Endgame starts)
- Trial time travel, Hawkeye takes a baseball glove
- Time travel to Asgard, Reality stone and Mjolnir taken, present-Thor talks with his mother
- Cap returns the stone and Mjolnir to Asgard (merges timelines 3 and 4 with timeline 1; 3,4->1)
- Time travel to Morag, Power and Soul stone taken, Star-Lord is knocked out, Thanos from this timeline travels to the original MCU timeline and is killed
- Cap returns the stones to Morag and Vormir (5,6->1; Gamora from timeline 5 presumably still alive in timeline 1)
- Time travel to 2012, Mind and Time stone taken, Loki gets hold of the Tesseract and disappears, future-Cap meets past-Cap and tells him that Bucky is alive, past-Ancient One talks with future-Banner
- Cap returns Mind and Time stone to 2012 (7->8; Loki still has escaped so this timeline cannot merge to timeline 1; it is unclear if Cap even needs to return the stones to this timeline)
- Time travel to 1970 taking Space stone (Tesseract), future-Tony talks with his father
- Cap returns the stone to 1970 (9,10->1)
- Cap travels (presumably) to 1940 and lives with Peggy Carter
- Old Cap time travels to the "original" timeline, effectively creating a new timeline (Endgame ends here)
It is unclear how Cap restores the stones to their original form (space stone as Tesseract, Mind stone in the scepter, Aether in Jane).
The merging of timelines implies Tony always talked with his father and Thor with his mother and Star-Lord was always knocked out. Also, the infinity stones were always taken and returned in the original MCU timeline, except for the Mind and Time stones, and they were absent for a moment since Cap cannot return them at the exact moment they were taken lest someone spots him. However, in the original timeline Cap never comes back from his quest of returning the infinity stones, as he needs to time travel to get there and thus he creates a new timeline (since he does not return through the time machine). The official MCU timeline at the end of the movie is therefore a new timeline different from the one Endgame started with, because, for whatever reason, Cap chooses to time travel to that moment instead of returning through the time machine.
We have a total of 5(+) separate timelines:
- Original MCU timeline where Cap never returns
- New MCU timeline where old Cap returns
- Timeline where Loki escapes with the Tesseract, the future and past Caps meet and the Ancient One talks with Banner
- Timeline where Cap marries Peggy, otherwise similar to original MCU timeline
- Timeline where Hawkeye took the baseball glove, otherwise similar to original MCU timeline
Note that the latter two timelines are presumably otherwise similar to the original MCU timeline: the snap happens, Avengers travel in time and create the above mentioned timelines again, unless the butterfly effect changes things up.
As if this wasn't long enough already...
Alternatively, we could assume that time travel does not necessarily create a new timeline and minor changes can happen. Major changes still create a diverging timeline. Minor changes introduced by time travel like the missing baseball glove or Cap laying low in the background from 1940 to present could still happen on the original timeline (meaning these always happened).
There are then three timelines in total:
- Original MCU timeline (including two Caps at the same time, one being married to Peggy)
- Timeline where Loki escapes with the Tesseract in 2012
- Timeline where Thanos and his army are gone (traveled to the future and got snapped), Gamora is missing (presumably in 2023 in original MCU timeline), perhaps also the timeline where Star-Lord was knocked out (thanks for @Rikaelus for pointing this timeline out, see their answer)
I do not remember the timing of removing the infinity stones and Loki getting the Tesseract in 2012 or if it was made clear in the movie. It could be possible for Cap to choose the points of time when he returns the Mind and Time stones so that the timeline of Loki escaping is somehow isolated. This leads to Banner always talking to the Ancient One and Cap always meeting his future self in 2012. Future-Cap could have erased past-Cap's memory of the exchange with the scepter(?). He probably did the same to the Hydra people.
However, this form of time travel has more ambiguous rules. If these things always happened in the past, it means that the time travelers need to introduce these changes exactly how they happened. Perhaps their actions and the flow of time is somehow regulated by the infinity stones. How can they then fail to produce the past exactly as it was and create a new timeline?
Personally, I prefer the three timelines outcome, and it seems to be the one hinted by the movies, despite the more ambiguous time travel rules. Peggy Carter is known to be married but the husband's identity is not revealed, hinting it might have been Steve all along.