The interaction of H, H2, and MgH2 with graphene is investigated using the density functional theory to explore the possibility of exploiting graphene or functionalized graphene as a hydrogen storage medium. The H atom is positioned at various distances from the graphene surface and the energetics are computed in detail. The extent of interaction of the s electron of H with graphene's pz electrons is well brought out. Similar investigations are carried out for H2, MgH2. In the case of H atom, a HC covalent bond is formed. This process turns out to be a prerequisite for proton transfer through graphene. Interactions of H2 and MgH2 with graphene are different from that of H. It leads to the conclusion that functionalized graphene will better substrate/candidate for applications like hydrogen storage.