For a router, (i think same as gateway), you simply have to enable IP Forwarding:
echo "1" > /proc/sys/net/ipv4/ip_forward
then you have to either set up your DHCP server to point to your linux machine as the gateway, or you have to manually set it up on your windows machine.
And you should also look into iptables, a firewall, to prevent tons of hackers accessing your computer.
Oh ya, you need 2 ethernet connectors on your linux machine, one that directly connects to the cable modem, and uses dhcp, and another that connects to your internal network, which has a manually set IP address and stuff, so that the comp. can forward packets from your internal network outside via cable modem. (i'm assuming you have cable, no clue what to do w/ dialup)