When I looked into it, the best I could work out was about six weeks. Bear in mind, there are some stations that only get one train a week...
Well I've just completed all the passenger lines in the NRTT (and quite a few now closed or freight only), plus all of the local tram/train systems and TfL, but it did take 50 years!
I did half the network randomly (work, leisure etc) until about 3 years ago I decided to blitz the rest before it was too late.
This took 60 day trips (from Chester) plus three 2-3 day overnighters with local railrovers (Cornwall/Devon, Norflolk and the Far North lines).
I travelled roughly weekly during the "light" season (spring/autumn mainly, avoiding school hols).
It also cost nearly £3000...
But well worth it.
The hardest line to reach from here was that through Melksham (Saturday afternoon only), followed by Gainsborough Central (ditto) and Knottingley-Goole (peak SX only).
The once-a-day lines to Fishguard and Heysham also needed careful scheduling.
I resorted to buses sometimes to skip from one line to another (Merthyr-Ebbw Vale, Milford Haven-Pemboke Dock, Whitby-Scarborough, Wemyss Bay-Largs/Gourock, High Barnet-Cockfosters, Oban-Inverness).
Transportdirect was very good for planning these.
My only big mistake was to miss a connection in Glasgow Central which meant I had to do another trip to reach Largs (but I fitted in a trip on the PS Waverley on the same day to make up!).