How much sleep is needed for peak cognitive performance? How much sleep is needed for peak cognitive performance? If some were to, for example, wake up one morning at 12:30PM, would a sleeping pill help obtain better sleep required for that performance the next morning at 08:00AM? And when would the optimal time be for the consumption of that sleeping pill? Is the amount of drawbacks in cognitive performance perceptible for 4.5 hours of sleep vs. 7 hours of sleep?
How much sleep is needed for peak cognitive performance. If some were for >example wake up one morning at 12:30 pm would a sleeping pill help obtain >better sleep required for that performance the next morning at 08:00 am ?


It depends on what pharmacotherapies - per the clinical judgement of their treating physician - one may have consumed. Conceptually, we might consider the two most psychopharmacologically relevant agents to be psychostimulants (coll. "uppers") and sedatives (coll. "downers" aka "goofballs").

Regarding sedatives, one's biggest concern would be a residual hangover effect. This is influenced by the agent's half-life (t½). For future reference, some 8 drug half-lives are needed for complete elimination. A short-acting benzodiazepine such as midazolam (t½ = several hours) is less likely to have residual effects than a long-acting barbiturate such as phenobarbital (t½ = 100+ hours). Non-benzodiazepine sedatives such as zolpidem appear so-so with regards to hangover, zaleplon seems to fair considerably better [1]. sedating antihistamines are horrendous [2]. If one had an enterically-coated "XR" tablet, one might do well to crush it up before swallowing, to ensure a more amenable pharmacokinetic profile.


  Is it perceptable the amount of drawbacks in cognitive performance in
  a situation of 4.5 hrs of sleep vs 7 hrs of sleep?


First, a caveat: individual differences apply here [3]. You know the answer for your own cognitive faculties better than anyone else. Interestingly, here is one paper that shows relatively modest drops in performance after acute sleep deprivation; chronic sleep deprivation, however, appears to have a deleterious dose-dependent effect [4]. 

Of direct relevance to your actual question, the above study notes:

Based on these findings, it appears that the inflection point (i.e. the minimum amount of nightly sleep required to achieve a state of equilibrium in which daytime alertness and performance can be maintained at a stable, albeit reduced, level) is approximately 4 h per night. [4]

Who'd've thunk, right?

The issue boils down to this:

Will the time you spend attempting to encode new memories into your LTM be more beneficial than the loss in attentional and executive function, as well as loss of potential REM-related memory consolidation and subsequent recall at the time of your examination?

When it comes to one's own therapeutic needs, it is always prudent that one consult with their treating physician. Here are my own reckless thoughts on the matter:


Ideal situation: if one's healthcare practitioner has prescribed them the sedative sodium oxybate (better known as GHB), then per oral administration of 4-5 grams GHB, followed by rapid onset of 4 hours of deep, refreshing sleep, might be indicated [5]. It would appear very unfortunate that GHB developed a reputation as a date rape drug, as anecdotally, some individuals consider it the "perfect sleep aid", particularly during exam periods.
If one's healthcare practitioner has prescribed them any of the following psychostimulants: d-amphetamine [6], modafinil [6] or perhaps methylphenidate they may wish to consider - per the recommendation of their physician, of course - skipping sleep entirely. Obviously, this is contingent upon their ability to recover following completion  of their work, study or family-related responsibilities, but may result in greater performance relative to brief, fragmented sleep.
If one's healthcare practitioner has prescribed them a short-acting benzodiazepine, one may still find that their sleep disorder is refractory and follows this particular clinical course: sleep from 10 pm  to 2-4 am, awakening, titration of caffeine as indicated. They may find that 4-6 hours post-awakening, their cognitive abilities are better than had they slept the same amount of time and awoken closer to 8 am.[7]


Remain valiant, soldier. Some people's best exam performances have come from around 3-4 hours of broken sleep care of a third of a bottle of Jack Daniels.  

References

[1] A comparison of the residual effects of zaleplon and zolpidem following administration 5 to 2 h before awakening http://onlinelibrary.wiley.com/doi/10.1046/j.1365-2125.1999.00024.x/epdf

[2] Next-Day Residual Sedative Effect After Nighttime Administration of an Over-the-Counter Antihistamine Sleep Aid, Diphenhydramine, Measured by Positron Emission Tomography http://journals.lww.com/psychopharmacology/Abstract/2010/12000/Next_Day_Residual_Sedative_Effect_After_Nighttime.9.aspx

[3] Inter- and intra-individual variability in performance near the circadian nadir during sleep deprivation. http://onlinelibrary.wiley.com/doi/10.1111/j.1365-2869.2004.00429.x/full

[4] Patterns of performance degradation and restoration during sleep restriction and subsequent recovery: a sleep dose-response study.
http://onlinelibrary.wiley.com/doi/10.1046/j.1365-2869.2003.00337.x/epdf

[5] Enhancing Slow Wave Sleep with Sodium Oxybate Reduces the Behavioral and 
Physiological Impact of Sleep Loss.
http://www.ncbi.nlm.nih.gov/pmc/articles/PMC2938863/pdf/aasm.33.9.1217.pdf

[6] Modafinil, d-amphetamine and placebo during 64 hours of sustained mental work. I. Effects on mood, fatigue, cognitive performance and body temperature. http://onlinelibrary.wiley.com/doi/10.1111/j.1365-2869.1995.tb00172.x/abstract

[7] Personal communications with myself.