I think both answers below missed a point or two. Indeed, the first step is the creation of a vicinal halohydrin. As the bromine molecule (Br2) approaches the π electrons of the 1-pentene, it becomes polarized (the individual bromine moieties taking on respective partial positive and partial negative charges-the bromine closest the π bond of the pentene taking the positive charge as each of the molecules' electrons repel each other). The π electrons of the double bond then fill the empty 4d orbital of the bromine that has the partial positive charge. The bromine with the partial positive charge then detaches from the bromine with the partial negative charge-releasing the σ electrons of the bromine-bromine bond leaving a bromine anion and brominium cation across the 1 & 2 carbons of the former pentene chain (during this concerted process, the electrons that initially went in and filled the 4d orbital are then demoted back to the 4p orbital after that orbital becomes empty from the breaking of the Br-Br bond). Since bromine is much more electronegative than carbon, the bromine of the bromonium moiety forces the positive charge onto the alpha and beta carbons; and because the primary partial carbocation is more unstable, it pulls on the bromine more strongly than the secondary partial carbocation, leaving a stronger partial positive charge on the secondary carbon. This stronger partial positive charge then is attacked by the lone pair of an oxygen from a water molecule (via anti addition) forming a new σ bond with the secondary carbon, opening the brominium ion. The water takes on the positive charge and is then deprotonated by the first lewis base it encounters in solution (either the bromine anion formed earlier or, more likely another water molecule), leaving behind the vicinal halohydrin "1-bromo-2-pentanol" aka "bromopentan-2-ol".
The next step is a bit nebulous since it first says "sodium hydride" and then says "sodium hydroxide", but this can be explained in that the product above is not isolated from solution, thus is still in an aqueous solution, and that sodium hydride reacts (violently) with water to produce sodium hydroxide and hydrogen gas. So, regardless of which base we start with, we still have sodium hydroxide acting on the vicinal halohydrin. The base first acts upon the hydroxy group, deprotonating it. This leaves an unconjugated formal negative charge on the oxygen. Keeping in mind that carbon 1 of this molecule is connected to both a halogen and the alpha carbon of an alcohol, we can see that it will have a significant partial positive charge. The deprotonated oxygen then attacks the partial-positively charged carbon via an internal SN2 reaction (remember SN2 rxn's invert stereochemistry). The bromine then leaves with the negative charge, leaving behind "1,2-epoxypentane" aka "pentene oxide.". assuming all acid formed during the vicinal halohydrin formation has been neutrilized by addition of enough base, the epoxide will have little tendency to react further with the water it is in solution with, but I would recommend isolating it.