For PAID dining plans, you must be staying at a WDW resort with a package that includes at least 1 day base tickets for each party member. A dining plan may be added/removed/changed up to 72 hours before check in. In all cases, all members of the party must be on the same plan and the plan may only be applied for the length of stay (note, split stays count as separate stays). There are a few exceptions and special cases:
1) DVC points stays - People staying on DVC points (members or renters) may add a dining plan (or remove/change) any time up to 48 hours in advance. No ticket requirement. DVC stays do not pay seasonal upcharge. Payment for the dining plan is due when added.
2) Passholder Ticketless Package - AP holders may book a "ticketless" package, which allows them to add dining without any ticket requirement. Only 1 AP holder is required for this. If converting from a room only to a package, package rules will then apply (deposits, balance due dates, change fees). Note that the room may only be booked at rack rate or at a passholder rate.
3) Military Tickets - Military staying at a WDW resort under the Military Salute tickets may book in a manner similar to AP holders above. There may be some other tweaks, but I'm not entirely sure.
Note for
Free Dining Plan promotions, the minimum ticket purchase is usually 2 day base tickets rather than the 1 day base tickets required for the "normal" case under paid dining.