Last week Wayne Gretzky topped 40,000 in the Pac-Man video game. It's not the only record he has broken recently. Gretzky, who just turned 21, is on his way to rewriting all National Hockey League scoring records. He's the highest-paid hockey player ever, with a near-$1 million contract in his pocket. He's closing in on the record for the highest-scoring player. And, in another game, he's just about the hottest name in licensing in Canada. His name is on a wide range of items, including jeans, chocolates and shavers. Coming up . . . a Wayne Gretzky Shopping Center.

And the Edmonton Oilers center, in town to play in the National Hockey League All-Stars Game tonight at Capital Centre, scores as one of the top fashion plates in sports today.

Yesterday, for lunch at the White House, where he sat at President Reagan's table, "The Great" Gretzy was wearing a perfectly tailored subtle brown plaid suit, the jacket indented at the waist, a white button-down shirt, and a medium-width foulard print silk tie. The president told the Canadian hockey hero, who looks a bit like a tall, skinny Baryshnikov, that he also played hockey when he was younger.

Gretzky says he wasn't much into clothes as a kid "except to look neat and clean . . . Suddenly you begin to notice that other people are noticing you at airports and banquets and you begin to want to dress better," says Gretzky, who has been the National Hockey League Player of the Month for October, November, December and January. He now has at least 20 custom-tailored suits and a dozen sport coats in his closet.

He used to take his fashion advice from his agent, Gus Badali, who has guided his name on everything in the hockey kingdom and beyond. (Only not on socks or underwear, because "you can't see 'em," jokes Gretzky.)

Badali's fashion, in contrast to the conservative Gretzky's, is back in the minor leagues where he once played left winger on the junior Weston Dukes. Says Badali, "Now he tells me: 'Gus, you can't wear your collars over your jacket anymore.' "

Gretzky's ideas on fashion come from the magazines, and occasionally he'll tear out a page of Gentlemen's Quarterly and show it around to fellow players. But whatever the magazines say, he takes some guidance from his father, Walter, a Bell Co. employe, who is in town for tonight's game. His mother is back in Canada watching his three brothers play in a hockey tournament.

"I got my hair cut because my parents like it short," admitted the slightly unshaven Gretzky. Short hair also saves him time blow-drying in the morning, he says.

His girlfriend, Vickie Moss, a club singer he met more than two years ago, started him on jewelry. She gave him the narrow gold chain bracelet he wears -- she wears six of the same -- when she came back from a trip to Hawaii, and a gold Longine watch. "He'd been eyeing it for a long time and thought it was too expensive so I bought it for him for Christmas," says Moss, who is with him in Washington.

Gretzky's on a budget set for him by Badali and his accountant, Ed Ross. It was $2,000 a month but went up to $3,000 with the new contract, says Badali. With it he must pay for his his two-story condominium overlooking the coliseum in Edmonton, food, incidentals and his not-so-incidental clothing costs.

He boosts his collection of custom suits each time he goes to Vancouver for a game. Tailor Paul Minichiello picks him up at the hotel and takes him to the shop where he makes quick decisions on fabrics. His silhouette remains the same. "I haven't changed my size in three years," says the six-foot, 170-pound Gretzky. He's recently had a couple of pairs of no-cuff pants lengthened to accommodate cowboy boots.

Minichiello, who makes suits for 200 hockey players, including Dennis Maruk of the Capitals, finds them "easy to dress. Most of them have good builds. They're not extra big like football players."

Coaches require players to travel in suits, so Gretzky usually opts for a fabric that holds its crease well "and won't look like an accordion after a trip to Washington," says Minichiello. "He knows what looks best for him and picks the best," he says. Minichiello charges Gretzky about $500 for each suit, which is a bit of a deal. "He looks better in a double-breasted suit than anyone I know."

For the moment Gretzky's role with his licensees, from which he earns $500,000 annually, is strictly endorsements. It includes TV commercials for 7-Up, which are seen in this country, and advertisements for Neilson's chocolates and Bic pens. At the 6-month-old Wayne Gretzky Western Corral he buys himself cowboy boots and western-style suits. He's got some ideas for a new design for G.W.G. jeans and he would like to see the pads on his hockey gear slimmed down a bit, particularly in the legs. Designing is the next step, says Badali.

Between games, Gretzky and his girlfriend relax by watching television; their favorite program is "Hart to Hart." He'll often wear sweat pants and a cut-off muscle T-shirt or sweat shirt. And he likes to play video games.

No surprise. Badali has just worked out a contract for Gretzky to endorse Odyssey, one of the most popular electronic games.