The best answer I can give you is that it depends on what you are talking about. Hatches I attach early on as I tend to try to paint things like bulkheads on the sprue, or at least before I attach them to the model. Other PE parts I attach as seems to make sense to me for the build sequence. I don't like leaving too much PE for the end of the build for fear of forgetting something. I tend to build in subassemblies, so I attach the PE that goes with each subassembly as I build it up. That includes the railings for that subassembly, attaching the railing once the subassembly is otherwise completed. Remember to try to attach the PE from the centerline out and down. As a general rule, that will give you the best result.
The one thing I always attach last is the main deck railing. It's just too easy to knock off a section of railing, or bend it beyond repair, if you attach it while you are still building. I'd also suggest that you attach your railing in short sections rather than long runs. Cut the railing in 2 -3 inch lengths at most, cutting at the stancions, and bend and attach as needed. I usually tack the railing with some CA and then once it has set I run a bead of white glue down the length of the base of the railing. Using this method I've never had a section of railing come loose. Another helpful trick is to attach small strips of Tamiya tape where you are going to attach railings, extending up a bit higher than the railing itself. This gives something to hold the railing section in place as the glue dries. Then, once the glue has set, gently remove the tape. If you have trouble with the tape pulling the railing, put a tiny amount of Zip Kicker on it, and it will immediately release from the railing.
Sorry to be so long winded. I hope this is helpful to you,
Bob
P.S.
You might consider investing in a book called "Ship Models From Kits" by David Griffith. Great book, well illustrated that has a wealth of information about different modeling techniques. It can be had from Amazon for around $20.00. Another good reference is "Basics of Ship Modeling" by Mike Ashey (also google his web site). Also available from Amazon for about $12.00. It also has a lot of good tips. I have both books and refer to them regularly when I'm working on a project.
Just launched: Revell 1/249 U.S.S. Buckley w/ after market PE and guns.
Building: Italieri 1/35 P.T. 596 w/ Lion Roar PE.