Robert F. Kennedy Jr. announced he was running for president as an independent, ending his bid for the Democratic nomination.