DH has some good pointers. Here are a few more... For holding everything in place, so you can line it up, etc. the easiest way is to just rest the rail down on the stairs and forget about trying to suspend it up in place. Get your top angle cut and then put back down on top of the stairs, confirm the top is nice and flush and mark the bottom using the newel post you have already installed. This is all assuming that the top wall and the newel are nice and plumb, otherwise the measurement could vary. I always end up cutting things a little long and trimming it about a million times until it fits. This way, you don't cut it too short the first time and waste an expensive railing. Also keep in mind that if the newel or wall isn't perfectly square to your rail that you will need a slight bevel as well as an angle.
Another way to do the top (different, not better) is to use a rosette. This is a piece of 3/4" oak that can be round, square, oval and have a nice edge routed on it. You make it a couple inches bigger in diameter than your rail stock. You then mount it to the end of the rail by screwing through the back of it (use stronger than drywall screws). Then you just screw through the rosette into the wall and plug it or use decorative acorn plugs. This is a quick and easy method - for those who know carpentry it looks cheaper but for those who don't ?? This is the way to mount it with glue and big toggle bolts if you didn't have a stud at the top for some reason.
Another way at the bottom is to use a very large screw or a small lag screw all the way through the post into the end of the rail. You can then cover the hole with a plug or decorative acorn plug. To prevent twisting of the rail you may need to put a small (2"?) screw up through the underside of the rail into the post. Pre-drill EVERYTHING and use wax in your threads to ease screwing. If you don't use the right sized bits then you might end up stripping a screw and you will be so bummin'. Also, use the strongest screws, like stainless steel, because if you snap a screw off you will be bummin' too.