I prefer to defragment (defrag) my computer at the start of each month, it probably doesn't need it quite that often but the start of the month is an easy date to remember.
My main computer still uses Windows XP so I need to start my defrags manually (some third party programs will let you set this to run automatically), if you use Windows Vista or 7 your defrags should happen automatically.
However they are only automatic when your version of Windows detects your machine is on but not currently being used, in some circumstances this may not be enough time for a proper defrag.
Hence why a monthly regime is a good thing to ensure a well defragmented computer hard drive.
Defragging your hard drive can take quite some time, half an hour to a couple of hours is typical so planning a good time for this procedure is important.
As always make sure you have a backup of your important data on another device (ie. not the same hard drive) before doing any operation on your hard drive.