Theoretically, a shapefile can contain about 70 million point features. The size of either the
.dbf files must not exceed 2GB.
Also, why bother creating a shapefile to insert to PostGIS? Try directly inserting the data using something like psycopg2, which makes the whole import process simpler, faster, and more direct.
Here are a few short examples to directly insert to PostGIS. First with simple point data, then with more complicated polygon data (a similar geometry construction and WKB export can also be done with OGR).
from shapely.geometry import Polygon
from binascii import hexlify
# Insert Point data into mypts
curs.execute('create table if not exists mypts(gid serial primary key, geom geometry(Point,4326));')
# Some longitude/latitude points (in that order!)
lon_lat = [(random.random(), random.random()) for x in range(100)]
curs.executemany('insert into mypts(geom) values(ST_SetSRID(ST_MakePoint(%s, %s), 4326));', lon_lat)
# Insert Polygon data into mypoly
curs.execute('create table if not exists mypoly(gid serial primary key, geom geometry(Polygon,4326))')
# Use Shapely to piece together exterior linear ring, and interior rings with lists of coordinates
poly = Polygon(shell=[(0,0),(0,10),(10,10),(10,0),(0,0)], holes=[[(2,2),(2,6),(7,7),(2,2)]])
poly_wkb = hexlify(poly.wkb).upper() # convert to ASCII version of WKB
curs.execute('insert into mypoly(geom) values(ST_SetSRID(%s::geometry, 4326));', (poly_wkb,))