Hi Mohammad! gmx hbond routine can give an idea about the number of hydrogen bonds as a function of time. If you use gmx distance then you can calculate the distance between a certain group of atoms as a function of time. That can be used for computing the lifetime of a certain hydrogen bond. In older version of Gromacs, like 4.6.7, you can compute g_bond which will be probably similar to distance. In all cases you need to provide relevant index files.
Use "gmx hbond" to deal with your trajectory, you will be asked to choose two groups, the H-bond between the two groups will be reported, including lifetime.