A good way of organizing your code is to put your main program into a function called main()
or similar:
def main():
sentence = input("Please enter sentence(s): ")
num_words = len(sentence.split(' '))
counter = 0
for x in sentence:
if x in "!?.":
counter += 1
print("There are", counter, "sentences and", num_words, "words.")
Then, underneath this, you write your code for repeating the function:
while True:
main()
if input("Repeat the program? (Y/N)").strip().upper() != 'Y':
break