You can use \rule[<raise>]{<width>}{<height>} to put a rule of width <width> and height <height>. <raise> - the optional argument - can be used to move the rule up or down (negative <raise>):

\documentclass{article}
\begin{document}
Name: \rule{15em}{.4pt}\ Class: \rule{5em}{.4pt}
Name: \rule[-.2\baselineskip]{15em}{.4pt}\ Class: \rule[-.2\baselineskip]{5em}{.4pt}
\end{document}
Perhaps, if you wish to have the rule fill the entire line, you can use a number of \hrulefills and actually raise the Name: and Class::
\bigskip
\raisebox{.2\baselineskip}{Name:} \hrulefill\hrulefill\hrulefill\
\raisebox{.2\baselineskip}{Class:} \hrulefill