The difference is that
std::getline — as the name suggests — reads a line from the given input stream (which could be, well,
operator>> reads a word1.
std::getline reads till a newline is found and
operator>> reads till a space (as defined by
std::isspace) and is found. Both remove their respective delimiter from the stream but don’t put it in the output buffer.
1. Note that
>> can also read numbers —