One of the major questions throughout Larry David (who also appears in some episodes), and it ran for nine seasons, throughout which Kramer enthuses about several get-rich-quick schemes. However, he never seems to earn enough to afford his lifestyle, and even Jerry comments on it within the show.
When Kramer is first introduced to Seinfeld viewers, he is Jerry's eccentric neighbor who often barges into Jerry's apartment and takes food from his fridge. But while these scenes picture him as a relatively poor man, other scenes show him making hefty sums, albeit through haphazard situations. In "The Subway," Kramer overhears a conversation about a horse bet and uses it to make a good $18,000. However, most times, Seinfeld's Cosmo Kramer doesn't benefit from his schemes - when he sues Java World with Jackie Chiles (Phil Morris) for burning himself with their coffee, he eagerly says "I'll take it" to free coffee for life before the company can complete their offer of $50,000.
Kramer's erratic lifestyle and lack of a steady job beg the question of how he could afford his Manhattan flat. In the early 1990s, the average rent for a one-bedroom apartment was $1,500. By 1998, when Seinfeld ended, the average rent had increased by $1,000. In "The Strike," Jerry and his friends learn that Kramer had been on strike at H&H bagels for 12 years - he would have been receiving some money this way. Together with the odd earnings from his Calvin Klein commercial or his coffee table book (published by Elaine Benes' colleague), this is the closest that Seinfeld comes to concretely explaining how Kramer affords his Manhattan apartment (and his somewhat lavish lifestyle).
Some alternative theories are implied by how mysterious of a character Kramer is throughout Seinfeld. In season 6, episode 11 "The Switch," Jerry, George (Jason Alexander), and Elaine (Julia Louis-Dreyfus) find out about Kramer's mom Babs (Sheree North), and through her, they learn his first name: Cosmo. Jerry congratulates Kramer for keeping his name a secret for a decade. It can be argued that, just like Kramer has been keeping his name and family a secret, he could have a secret inheritance, for example, from his father (who is never mentioned in Seinfeld). Another possible explanation echoes that of Friends' Monica and Rachel affording their apartment: when Jerry tries to get Elaine an apartment in his building, he mentions the building is rent-controlled. This meant that their flats would cost around $300-400/month, much less than the Manhattan average at the time.
Seinfeld never directly explains how Kramer can afford his apartment (and all the vintage clothes and golf sessions). Throughout the show's nine seasons, Kramer mostly lives hand-to-mouth, with intermittent financial success through more or less questionable endeavors. But perhaps the best explanation comes from George in "The Visa:" "Do nothing, fall ass-backwards into money [and] mooch food off your neighbors."