What are the main roles of NADH and NADPH in the energy synthesis processes?
NAD+/NADH and NADP+/NADPH are very similar molecules in both structure and function. Compositionally, they are differentiated only by the substitution of a phosphate group in NADPH, which is where the "P" in its name comes from. Metabolically, they behave in a similar manner as well; they are both referred to in binary terms because the presence or absence of a hydrogen determines the role they are capable of performing at a given time. Both are oxidizing and reducing agents, frequently shortened to "redox," meaning that they are capable either of donating or removing a pair of electrons, depending on their structure: the "+" forms are electron acceptors (oxidizers) and the "H" forms are electron donors (reducers). These terms can be tricky to manage; just know that whatever happens to one molecule, the opposite term is what happens to it at the end of the reaction; if NAD+ oxidizes (takes electrons away) from a molecule, the NAD+ becomes NADH, and we would say it has been reduced. Being comfortable with this terminology is mostly a matter of practice.
Oxidizers, in an overly simplified way, can be thought of as bond breakers, and reducers can be thought of as bond injectors. Basically, if you throw NAD+ or NADP+ at something, it will probably break that molecule into something smaller. If you throw NADH or NADPH at something, it will add new bonds to that molecule, making it larger.
Since they're so similar, it's worth asking why we need two different oxidizer/reducer agents in the body. The answer lies in their nature; since they can perform two functions, it's better to have one classified as "predominantly the reducers" and the other as "predominantly the oxidizer" by virtue of their quantity in the body. The amount of NADPH tends to be high, as it is used as a reducer, and NAD+ is kept high, so it can be used as an oxidizer.
You're probably familiar with NAD+/NADH and NADP+/NADPH through respiration and photosynthesis. NAD+/NADH is primarily involved in respiration, and NADP+/NADPH in photosynthesis, although it has some functions in animals as well. The NAD+ performs an intermediary role between glucose breakdown and ATP synthesis; the NAD+ takes electrons from the glucose and becomes NADH, which then brings the electrons to the electron transport chain, which ultimately drives the synthesis of ATP.
NADPH, on the other hand, doesn't have a direct role in "energy synthesis." Since its job is to build molecules up rather than break them down, it can be said to have a role in the generation of glucose, but not in the release of its energy. On the other hand, NADPH is one of the products of the light reactions in the chloroplast membrane, so we could say that the "role" of NADPH in energy synthesis is as one of its products as well as an intermediary.