Long endurance riding is key to training for an ultra endurance cycling event like a long audax, Paris-Brest-Paris or a Bikepacking event. If you have never ridden for more than a few hours this can be a daunting prospect so here are some tips to help you build up the distance in a manageable way.
It really doesn't matter where you start from so long as you give yourself enough time to build up. As a general rule adding about half an hour to your longest ride week on week is a reasonable way of building time in the saddle.
A good routine is to aim to build like this for 2 to 3 weeks and then have a 'light week.' Following a 4 week rota where every 4th week is light it would then take you 12 weeks to go from 1 hour to 6 hours of riding.
Once you can regularly tolerate 5-6 hours of riding you can begin to plan your big weekend blocks/events every 4-6 weeks.
Doing very long rides every weekend isn't always feasible and can create a lot of fatigue. It can be better to plan big weekend blocks of training with long (eventually back to back) days once every 4 to 6 weeks. This gives you time to taper and recover from the block and still get in some decent periods of regular training in between.
Another good way to build up fatigue resistance is doing back to back days. This can initially just be getting on the trainer for half an hour the day after a big weekend ride and building gradually from there. This again will get you used to getting back on the bike when you are tired and build up some fatigue resistance.
The trick to going long is to keep a sustainable pace. At first you might feel like you are going ridiculously slow, but don't worry you will get faster the more of this type or riding you do. You are aiming to ride in your zone 2 as per the table below, but if you don't want to do a test to find out your zones aiming to keep riding at a pace that you can hold a conversation at is a good rule of thumb.