Quickly double tap then hold the forward key (default is W) to sprint.
Alternatively, in version 1.7.2 or later, you can hold Ctrl and W instead of double tapping it.
You cannot sprint if your hunger bar is 6 units (3 steak barsdrumsticks ) or lower.