For most people, you don't need to do it any more. Many still do though, either because they've been told it helps from someone else, or from doing it years ago.
Most popular modern operating systems (Windows XP and above, Mac OS X, some GNU/Linux distributions) do the defrag process in the background when the hard drive is idle for short moments of time.
However, these processes only do the smaller files on your disk. Since most files are small (i.e., less than about 30MB or so), it works quite well.
They don't do the same sort of thing for very large files. So, if you're someone who uses large files a lot, such as video editing, then you may want to defrag once every few weeks or month or so.