A detail from the painting, which was on a 1951 cover of the Saturday Evening Post
Saying Grace shows a crowded restaurant with a grandmother and grandson bowed in prayer at a table they are sharing with two young men.
The painting's pre-sale estimate by Sotheby's was $15m to $20m. The buyer's identity was not disclosed.
Ten Rockwell works in total were sold at the auction.
The Gossips sold on Wednesday for just under $8.5m, while Walking to Church fetched more than $3.2m.
Many came from the family of Kenneth Stuart, the art editor at the Saturday Evening Post at the time when many of Rockwell's paintings were featured on the magazine's covers.
The paintings were part of a larger American art auction at Sotheby's that took in almost $84m in total proceeds.
The previous record for the sale of an American painting at auction was set in 1999, also at Sotheby's, when George Bellows' Polo Crowd sold for $27.7m.