What factors affect soil hydration and crop growth time? What is the most efficient layout of dirt and water to grow crops?
Like Brant said, tilled soil will stay tilled if it has a water tile four blocks or less away. Even though a large field of crops would result in the quickest growth time, this is not necessarily the most efficient method of farming as you would need to crouch to avoid the trampling of crops, and it's not easy to access each tile.
There is a thread on the Minecraft Forums with various farm designs - here are two of them (credit to Hans Lemurson of the forums):
The tilled blocks are raised so you won't trample crops as you collect them, and the water tile in the middle ensures that all the crops are exposed to the water. The nice thing about this design is that you can elongate the design simply by repeating the middle row (the one with water in it). The walls of the farm serve a double purpose - keeping animals out and serving as a back wall so that harvest crops bounce back to you.
(Oh, and the chest at the door is good for storing excess seeds or wheat.)
This is a spiralled variation of the farm. The crops are one continuous "shelf", so can hold the mouse button and move as you are planting or harvesting.
To be hydrated, tilled soil needs have water up to four blocks away, either on the same level as the soil or one level above it. This means a 9x9 field with a single block of water in the middle will be fully hydrated.
Growth time is a little bit more complicated. The Minecraft wiki has more information including the formula the game uses to determine growth rate, but it would seem that the quickest-growing crops are those surrounded by crops on either two sides. In other words, plant in straight lines. Avoid large fields and L shapes. If using large fields then alternate crops every row.
A single block of water will manage to hydrate a 9×9 square on the same y-axis height around it, giving a total of up to 80 blocks hydrated.
A freshly tilled farmland block will get randomly hydrated when near a water block. Flowing water will also manage to hydrate surrounding blocks.
If the water source is removed, the farmland will randomly dehydrate and then get reverted to a dirt block. A dehydrated farmland block with crops planted will not get reverted; the crop planted will continue to grow at a decreased rate.
This design is effective since crops will get trampled only by jumping on them. In order to prevent drops falling into the water, a lily pad can be made use of:
Water will still provide hydration to farmland, even if apart:
Crops also will not grow at light levels of 7 or lower, making them not grow at night if not near a light source. Additionally, at light levels of 4 and lower, crops will un-plant themselves. This, in practice, means that when not lit up, one's crops will not grow half the time. To fix this, just place a light source above each lily pad. Note that this light layout will not cover the 4 corner blocks.
This design can be stacked up, on the screenshot you can see 9 water blocks hydrating 720 blocks of farmland:
The same design can be modified for use in automatically harvested farms. An example is shown below.
@RudolfJelin explained how you can get as many crops as possible from as little water as possible. That is good if you want to build massive farms, but if you want your crops to grow the fastest, you have to plant them in alternating rows. For some reason, crops always grow faster that way. But you can make them grow even faster, if you add a beehive and some flowers nearby. Adding light also allows for more speed, because crops will grow during the night as well. You could waterlog a trapdoor and close it, so that neither the crops nor you fall into the water. You can add as many rows as you want. So something like this would make your crops grow the fastest: