To do so first of all install samba.
In Ubuntu install it by opening a terminal
sudo apt-get install samba
Start it by
sudo /etc/init.d/samba start
You don't need to do this after restart as it gets started automatically on boot.
Now create a password for your user
sudo smbpasswd -a
Share any folder and on windows computer when accessing the share use the above username and newly created password.