The 27-year-old travelled to the North East on deadline day to undergo a medical and finalise the deal after the two Premier League clubs had agreed the fee.
Graham, who joined Swansea in the summer of 2011 from Watford, has made 23 appearances this season, 10 as substitute, and scored seven goals.
Graham, who was born in Gateshead, told his new club's official website: "As soon as I heard about the interest from Sunderland I didn't even have to consider any of the other options that were on the table.
"I was born and brought up in the north east so I know first-hand the intense passion that people have for their football in this part of the world - it's special and there's nowhere else like it."
"Of course, I totally understand that some fans might need convincing about my commitment to Sunderland because of my roots, but I've always given 100% no matter what team I play for and no matter who I play against.
"It's up to me to show people I deserve to wear the Sunderland shirt and I'm excited about playing for a club as big as this. I'm really excited about the future - this is a new phase of my career and I can't wait to get started."
Graham has been linked with Sunderland throughout the transfer window after finding his first-team opportunities with the Swans limited. The Black Cats have been searching for a new striker in January after releasing Louis Saha and allowing Fraizer Campbell to join Cardiff.
Championship side Middlesbrough - Graham's first club - made a late attempt to hijack the deal on deadline day but Graham told Boro he had no interest in dropping out of the Premier League.
Sunderland manager Martin O'Neill has spoken of his delight at securing Graham.
"Danny will work hard for the team and did very well at Swansea, where he had a good season last year," O'Neill told Sunderland's official website.
"We're delighted to have Danny and I genuinely think he'll do well for us. He has a real desire to do well.
"I saw him from afar last season when he played very well in a system which seemed to suit him."
O'Neill says his new signing has a vital role to play in taking the scoring load off 10-goal leading marksman Steven Fletcher.
"I think Danny can fit in and score a few goals for us. We want to be less reliant on Steven Fletcher scoring the goals. I think Danny will alleviate the load; that's my expectation and I think he feels the same."
To find out more about live football on Sky sports, Click here