Giving actual username from Gmail ID
def return_gmail_user(email):


Return isn't a very descriptive word to use as the beginning  of a function name. Call it parse_gmail_user or something along those lines instead.

    username = email.split('@')[0]
    domain = email.split('@')[1]


Read up about sequence unpacking. There's no need to use indices directly, just assign the result of the split operation directly to both variables.

    valid_email_char = '[\w\d\.]+'
    # check if email is of gmail
    if domain != 'gmail.com':


The comment is redundant, it adds nothing to the code — remove it.

        return False


It would be more Pythonic to raise an exception instead of returning False.

    # get username
    m = re.match(valid_email_char, username) 


Give m a descriptive name, such as valid_user, making the code more fluent.

    if m:


You could combine the two if statements to fail early if an incorrect value is given for email.

        username = m.group(0)


group retrieves the first group by default, no need to supply 0.

        #print username


This comment is probably a remnant from testing; commented-out code should be removed immediately as it adds clutter and serves only to confuse.

        return "".join(username.split('.'))


replace('.', '') would be a more descriptive option of achieving the above.

    return False




Following my suggestions, you could arrive the below solution.
Note that the semantics are insignificantly different (the match is performed regardless of the validity of the domain), but readability and simplicity is substantially better.

def return_gmail_user(email):
    user, domain = email.split('@')
    valid_user = re.match('[\w\d\.]+', user)
    if domain != 'gmail.com' or not valid_user:
        raise ValueError('invalid gmail address: ' + email)
    return valid_user.group().replace('.', '')